SimplConvert

JSON formatter & validator

Beautify, validate, minify and repair JSON.Runs in your browser, nothing uploaded

Loading the tool…

About JSON formatter

Paste JSON, or open a .json file, and get it back neatly indented and easy to read. If the JSON is broken, the formatter tells you what is wrong and the line and column where it happens, so you can fix it in seconds instead of hunting through one long line.

You can also minify JSON to make it as small as possible, sort the keys alphabetically to compare two files, or let the Repair button fix common mistakes such as trailing commas, single quotes, comments and missing quotes around keys.

How to use it

  1. Paste your JSON into the left box, or press Open file to load a .json file.
  2. Choose Format to beautify it, or Minify to remove all spacing.
  3. Pick the indent you like (2 spaces, 4 spaces or tabs) and, if you want, turn on Sort keys.
  4. Copy the result or download it as a .json file.

What the Repair button fixes

JSON copied from JavaScript code, logs or configuration files often is not quite valid. Repair fixes trailing commas, single-quoted strings, unquoted keys, comments, missing commas between items, Python-style True/False/None and unclosed brackets at the end of a cut-off file. Check the result afterwards: when the input is very broken, Repair has to guess what was meant.

Reading error messages

When the JSON is invalid, the message names the line and column, and that line is highlighted in the editor. The real mistake is often just before that point: a missing comma at the end of the previous line, or a quote that was never closed.

Format, minify or sort: when to use each

Format is for reading and reviewing. Use 2 spaces for most web projects, 4 spaces if your team’s style guide says so, and tabs if your editor is set up for them. Minify is for sending JSON over a network or embedding it in code, where every byte counts. Sort keys puts object keys in alphabetical order, so two files with the same data in a different order look the same and are easy to compare.

The result updates as you type or paste, so you can see the effect of each setting straight away.

What each option does
OptionResultTypical use
Format, 2 spacesIndented, readableConfig files, API responses
Format, tabsIndented with tab charactersProjects that use tabs
MinifyOne line, no spacesProduction payloads
Sort keysKeys in alphabetical order, at every levelComparing or diffing files

Limits

Files you open from disk can be up to 60 MB. Pasted text has no fixed limit, but very large JSON uses a lot of memory and may make the page slow.

Sort keys applies to objects only. The order of items inside an array is never changed. It also sorts every level of the data, not just the top one.

JSON Lines (one value per line, as in .jsonl and .ndjson files) is recognised. Each line is formatted on its own and the status line says how many values it found.

Numbers are read the way a browser reads them, so integers beyond 9,007,199,254,740,991 (2 to the power 53, minus one) lose their last digits. Long IDs from some systems are affected. Keep those as strings in your data, or do not paste them here.

Troubleshooting

Why does Format change my numbers? Values such as 1.0 become 1 and 1e3 becomes 1000, because the number is read and written back in its simplest form. The value stays the same.

Why did a key disappear? JSON allows repeated keys but only the last one can be kept, so earlier duplicates are dropped when the data is read.

Why are my keys in a different order? Keys that are whole numbers, such as "2" and "10", are always listed in number order by the browser, ahead of other keys. Turn on Sort keys if you want a predictable order.

Why does it say “Unexpected token” on a valid-looking file? Check for a comma after the last item, or text before the first bracket (such as a variable name). Repair can fix most of these.

Questions

Is my JSON sent anywhere?

Everything happens inside your browser. Your file is never uploaded to a server, so it stays private and the tool keeps working even on a slow connection.

How large a file can it handle?

Files of several megabytes format comfortably. Very large files (50 MB and up) depend on your device’s memory; minify is faster than format for those.

Does sorting keys change my data?

No. Objects in JSON have no meaningful key order, so sorting only changes how the file reads. Array items always stay in their original order.

Can it format JSON Lines (NDJSON)?

Yes. If every line is a separate JSON value, each line is checked and formatted on its own, and errors name the line that failed.

What is the difference between JSON and a JavaScript object?

JSON is stricter: keys and strings need double quotes, and comments, trailing commas, undefined and functions are not allowed. Repair turns most JavaScript-style objects into valid JSON.

Can it open JSON from a .har, .map or .geojson file?

Yes. Those files are JSON underneath, so you can open them and format them like any other JSON.

Does Minify change the data?

No. It removes spaces and line breaks outside of strings only. The keys, values and order stay the same, apart from the number formatting described above.