JSON Converter Online
Paste your JSON, pick a target, and convert it in your browser. The Convert tab writes CSV, YAML, XML or SQL INSERT statements; the Schema tab writes TypeScript types or a JSON Schema; Format and Minify change only the layout. If the JSON is invalid under RFC 8259, for example with a trailing comma or single quotes, the page repairs it first.
Convert JSON online
Pick a tab, then a target where there is a choice. All conversion runs in your browser; the page sends nothing to a server. There is no fixed size limit: the converters work on whatever your browser can hold, and very large inputs make the page slower.
- Convert → CSV — an array of objects becomes rows; keys become columns.
- Convert → YAML — the same data as YAML, with strings quoted where a YAML parser could read them as something else.
- Convert → XML — elements named after the keys, inside
<root>; array members become repeated elements. - Convert → SQL — one
INSERT INTO data (…) VALUES (…);per object. - Schema → TypeScript — interfaces inferred from the sample; keys missing from some objects become optional.
- Schema → JSON Schema — a draft 2020-12 schema with
type,properties,requiredanditems. - Format and Minify — the same JSON, indented or on one line.
The single-purpose pages for two of these are the JSON to CSV converter and the JSON to TypeScript generator.
How to convert a JSON file
- Click Upload and choose the .json file, drop it on the editor, or paste the text.
- Pick the tab and the target format.
- Click Copy, or Download to save it (
data.csv,data.yaml,data.xml,data.sql,types.tsorschema.json).
The sample in the editor converts to this CSV:
id,name,role,tags
1,Ada,admin,"[""math"",""code""]"
2,Grace,editor,Convert JSON to a readable format
Minified JSON is hard to read but means the same thing as indented JSON: RFC 8259 allows any amount of whitespace between tokens. The Format tab indents with 2 or 4 spaces and can sort keys A–Z; the JSON formatter does the same on its own page, and the minifier goes the other way.
How to open a .json file
A .json file is plain text, so any text editor opens it; RFC 8259 requires UTF-8 when JSON is exchanged between systems. To read it as a tree, use the JSON file viewer.
Convert invalid JSON to valid JSON
With Auto-repair input on (the default), broken input is repaired before it is converted, and the output pane is marked auto-repaired. These are the engine's results on common faults:
| Problem | Invalid JSON | Reported error | Repair result |
|---|---|---|---|
| Trailing comma | {
"a": 1,
"b": 2,
} | Line 4, column 1: Trailing comma — remove the comma before the closing }. | {"a":1,"b":2} |
| Single quotes | {
'a': 1
} | Line 2, column 3: Property names must use double quotes ("), not single quotes. | {"a":1} |
| Unquoted key | {
a: 1
} | Line 2, column 3: Property names must be wrapped in double quotes. | {"a":1} |
| Comment | {
// note
"a": 1
} | Line 2, column 3: Comments are not allowed in JSON — remove them. | {"a":1} |
| Python True | {"a": True} | Line 1, column 7: "True" is not a JSON value — use true, false or null (lowercase), and quote anything else. | {"a":true} |
| NaN | {"a": NaN} | Line 1, column 7: "NaN" is not a JSON value — use true, false or null (lowercase), and quote anything else. | {"a":null} |
| Leading zero | {"a": 012} | Line 1, column 7: Numbers cannot have leading zeros (write 7, not 07; quote it if it is an ID). | {"a":"012"} |
Two rows are guesses: NaN becomes null and 012 becomes the string "012". To see every change before converting, run the text through the JSON repair tool first, then check it in the validator. Parser messages by language are under JSON errors.
What JSON cannot convert to losslessly
- CSV is flat. A nested object or array is written into one cell as JSON text (the
tagscell above), and the page says so under the output. A top-level array of numbers or strings cannot become CSV at all. - CSV has no types.
true,1and"1"all become plain text;nullbecomes an empty cell, the same as a missing key. - Mixed keys. Columns are the union of all keys in first-seen order; a row without a key gets an empty cell.
- XML has no arrays or nulls. Array members become repeated elements and
nullbecomes an empty element, so the way back to JSON is ambiguous. - Large numbers. The input is parsed with JavaScript's
JSON.parse, so integers beyond 253−1 lose precision before conversion; RFC 8259 notes that such numbers are not reliably exchanged.
Related JSON tools
XML to JSON converts the other way. JSON Schema generator, diff, the conversion guides (CSV, Python, YAML and TOML), Learn JSON and the full JSON Studio.
Frequently asked questions
Click Upload (or drop the file on the editor), pick a target on the Convert tab (CSV, YAML, XML or SQL) or on the Schema tab (JSON Schema or TypeScript), then copy the result or click Download.
Use the Format tab to indent it with 2 or 4 spaces. RFC 8259 allows whitespace between tokens, so the data stays the same.
A JSON file is plain text, so a text editor opens it. To read it as a tree, use the JSON file viewer; to convert it, upload it here.
Yes. The converters on this page run in your browser, need no signup and are free.
Paste it in with Auto-repair input on (the default). The page repairs faults such as trailing commas, single quotes and Python True/False/None before converting. Use the Repair view on the JSON repair tool to see each change, and review the output when the repair had to guess.
The JSON Medic newsletter
One JSON error and its fix, weekly, plus new guides and tools. Free.
We send a confirmation link first. Unsubscribe with one click in any mail. See the privacy policy.
Related JSON tools