JSON to Flow
Paste JSON and instantly get clean Flow type aliases with the root type named Root and nested objects extracted into their own named types.
Reviewed by the CalcCafe editorial team · Last updated 1 July 2026 · How we test our tools
Example
Given this JSON input:
{
"id": 1,
"name": "Ada",
"tags": ["dev", "admin"],
"profile": { "age": 36, "city": "London" }
}JSON to Flow emits:
export type Profile = {
age: number,
city: string,
};
export type Root = {
id: number,
name: string,
tags: Array<string>,
profile: Profile,
};
How it works
Parses your JSON, infers each value's Flow type, and emits export type aliases. Nested objects become their own named types and arrays are typed by their merged element shape.
Good to know
JSON to Flow turns a sample of real JSON into Flow type aliases you can paste straight into a JavaScript file annotated with // @flow. It is aimed at developers maintaining Flow-typed codebases who want to model an API response, a config blob, or a fixture without hand-writing every field. You paste JSON on the left, click Convert, and get a set of export type declarations on the right.
Reach for it whenever you have a concrete example of the data but no schema. Typical moments are wiring up a new endpoint, typing a third-party payload, or adding annotations to legacy code where the shape is only documented by what the server actually returns. Because everything runs locally in the browser, you can safely paste responses that contain internal or sensitive fields.
To read the output, start at the type named Root: that is the top-level shape. Every nested object is pulled out into its own named type (for example a profile key becomes a Profile type that Root references), and arrays are typed by their element shape, so a list of post objects produces a singularized element type. The status line under the panes tells you how many types were generated, which is a quick sanity check that nesting was detected as you expected.
One caveat to keep in mind: the types describe only the sample you paste, so a field that happens to be null or absent in your example will be typed as null or simply left out rather than as optional. For arrays of objects the tool merges fields across all elements, so feed it a few representative items to capture every key, and treat the result as a starting point you refine with optional markers and unions where the data can legitimately vary.
Frequently asked questions
How are nested objects and arrays of objects handled?
What does the root type get named?
Is my data uploaded anywhere?
Is it free?
People also ask
What is Flow and how is it different from TypeScript?
Does the generated Flow code mark fields as optional?
How does it handle null values in my JSON?
Can I convert a top-level JSON array instead of an object?
Do I need to install anything to use the Flow types?
What happens if I paste invalid JSON?
How are duplicate object shapes handled in the output?
Related tools
- JSON to JavaScript PropTypes
- JSON to TSV
- JSON to Base64
- Base64 to JSON
- JSON to JSON Schema
- CSV Escape
Sources & references
These tools follow our methodology and provide educational estimates only — verify important figures with a qualified professional.