JSON to F# Record Generator

Generate F# record type definitions from JSON data with automatic type inference.

What is JSON to F# Record Generator?

This tool converts JSON data into F# record type definitions. It automatically infers F# types from JSON values, generates PascalCase field names, and creates properly structured record types with nested type support.

How to Use

  1. Paste your JSON data into the input area
  2. Click "Generate" to convert JSON to F# record types
  3. Copy the output and paste it into your F# project

Why Use This Tool?

Automatically infer F# types from JSON values (string, int, float, bool)
Generate clean F# record type definitions
Handle nested objects as separate record types
Use PascalCase naming following F# conventions
Support for option types and list types

Tips & Best Practices

  • Use realistic sample data — type inference depends on actual values
  • Nested objects become separate record types with PascalCase names
  • Null values are typed as 'a option for flexibility
  • Empty arrays are typed as 'a list

Frequently Asked Questions

How are JSON types mapped to F#?

JSON strings → string, integers → int, floats → float, booleans → bool, null → 'a option, arrays → T list, objects → separate nested record types.

What is a record type in F#?

A record is a simple aggregate of named values, optionally including members. Records are reference types and provide structural equality by default, making them ideal for representing data.

How are nested objects handled?

Nested JSON objects are converted to separate F# record types. They are ordered children-first so that referenced types are defined before the types that use them.

Why are field names in PascalCase?

F# naming conventions use PascalCase for type names, public values, and record fields. This tool follows the standard F# style guide.

Is my data sent to a server?

No, all processing happens entirely in your browser. Your JSON data never leaves your device.

Related Tools