Developer

JSON Editor

Details

How to use JSON Editor

What the tool does, how to run it, and what to expect from the result.

How to validate and format JSON

Paste your JSON and it is parsed on every keystroke. A valid document reports its root type plus a recursive count of keys and leaf values; an invalid one reports the parser's message with the line and column translated from the raw character offset.

Once it parses, you can pretty-print it with 2-space indentation or minify it to a single line.

  • Paste the JSON into the editor.
  • If it is invalid, jump to the reported line and column, and check first for a trailing comma, a comment, or a single-quoted string.
  • Once the status line says it is valid, read the key and value counts as a sanity check on the shape.
  • Click Pretty-print for 2-space indentation, or Minify to strip all optional whitespace.
  • Copy the result; nothing was uploaded at any point.
Tips

Getting a better result out of JSON Editor

Specific settings and thresholds, not general advice.

  • Parse errors are reported with a line and column, not only a character offset. The browser gives you a position number, which the tool converts into a 1-based line and column so you can actually find it in a 400-line file.
  • The key and value counts are recursive: keys counts every object key at every depth, and values counts every leaf primitive, including the ones inside arrays. Array indices are not counted as keys, which is why an array of 10 flat objects with 5 fields shows 50 keys.
  • Pretty-print uses exactly 2-space indentation, the JSON.stringify convention that most linters and diff tools expect. Minify strips every optional byte, which routinely cuts a formatted config file by 20 to 30 percent before compression.
  • JSON is stricter than most people remember: no trailing commas, no comments, no single-quoted strings, and keys must be double-quoted. Almost every "why is my JSON invalid" turns out to be one of those four, and none of them is legal no matter what your editor lets you type.
  • Round-tripping through parse and stringify is lossy in one specific way: key order is preserved but numeric precision is not. A number beyond the range of a 64-bit float, such as a 19-digit Twitter-style ID, will silently lose its last digits. Keep large IDs as strings.
Limits

What JSON Editor does not do

The honest boundary, so you do not lose time finding it yourself.

  • No JSON5, JSONC, or NDJSON support; comments and trailing commas are errors.
  • No schema validation and no JSONPath or query.
  • No tree view or collapsible node editing; it is a text editor with validation.
  • No file open or save; paste in and copy out.
Reference

Terms used on this page

Short, plain-language definitions for the formats and settings above.

At a glance

Who JSON Editor is for

A quick way to understand who this helps, what it solves, and where it connects next.

Best fit

Developers editing and validating JSON.

Ideal for

Using the json editor without installing anything or signing up.

FAQ

Common questions

Short answers for the questions people usually have before trying a utility like this.

Why does my JSON with comments fail?

Because comments are not part of JSON. The specification has no // or /* */ syntax, and JSON.parse rejects them. Editors like VS Code accept them in their own config files by using JSONC, a superset, but a real JSON parser will not. Strip the comments, or use YAML or JSON5 if you need them.

What is a trailing comma and why does it break everything?

It is the comma after the last item in an object or array, as in [1, 2, 3,]. JavaScript allows it in source code; JSON does not, full stop. It is the single most common JSON syntax error, and it is why the error position usually points at the closing bracket rather than at the comma itself.

Is minifying safe for a config file I have to edit later?

It is lossless in terms of data but destructive to readability, and it wipes out your formatting choices permanently. Minify what is going over the wire and keep the pretty-printed version in version control. You can always re-expand it here, but you will not get your original line breaks back, only the canonical 2-space form.

Why did my large ID number change?

Because JSON numbers are parsed as IEEE 754 doubles, which hold about 15 to 16 significant decimal digits exactly. A 19-digit identifier does not fit, so the last digits are rounded and the value you get back is not the one you put in. The fix is not in this tool: store large IDs as strings in your JSON in the first place.

Does the tool reorder my keys?

No. Both pretty-print and minify go through JSON.parse and JSON.stringify, which preserve the insertion order of string keys, so your keys come back in the order they were written. What does change is the whitespace, and, if you had any, the escape form of certain characters, which is normalised.

Recommendations

You Might Also Like

Nearby tools from the catalog that fit the same job or workflow.

Cleanor app

Do it all on your device

Cleanor puts these tools in one app: compress and convert images, video, and audio, work with PDFs, and scan text right on your device. Plus free up storage and clear inbox clutter with Email Cleaner. Start with a free trial.

  • iPhone
  • Android
  • Macsoon
  • Windowssoon