JSON Formatter & Validator
Format, validate and fix JSON: exact error line and column, beautify or minify, tree view, big numbers kept exact.
- Free
- No sign-up
- Runs in your browser
See it in action
Big numbers keep every digit
{"orderId":12345678901234567890,"price":19.90}{name:'Ada',}
Line 1, column 2Property names must be in double quotes
Paste JSON above, or tap an example. It is checked and formatted as you type.
Escape or unescape text for a JSON string
Runs in your browser. Nothing you type is uploaded or stored, and no sign-up is needed.
Updated
See it in action
Big numbers keep every digit
{"orderId":12345678901234567890,"price":19.90}{name:'Ada',}
Line 1, column 2Property names must be in double quotes
This JSON formatter and validator checks your JSON as you type and lays it out with clean indentation. If something is wrong it shows the exact line and column, explains the mistake in plain words and can fix common ones for you, such as trailing commas, single quotes, unquoted names and comments. Beautify or minify, sort keys, switch to a tree view, and copy or download the result. Numbers keep every digit. It is free, needs no sign-up, and your JSON never leaves your browser.
How to use it
Paste your JSON, open a .json file, or tap an example. It is checked and formatted as you type.

If the JSON is invalid, read the error: it gives the line and column, shows the line with a marker, and explains the fix. Press Fix it for common mistakes, or Go to line to jump there.

Choose Beautify or Minify, the indent and whether to sort keys, or switch to the tree view. Then copy the result or download it as a .json file.

Options
- Beautify
- Lays the JSON out one value per line with the indentation you choose, so nested objects and arrays are easy to read.
- Minify
- Removes every space and line break that JSON does not need, for the smallest text to send or store.
- Indent
- 2 spaces, 4 spaces or a tab per level.
- Sort keys A–Z
- Orders the names inside every object alphabetically, which makes two versions of the same data easier to compare.
- Text or tree view
- The text view shows the formatted JSON with colors for names, strings, numbers and true/false/null; the tree view folds objects and arrays so you can open only what you need.
- Validation
- Checks the JSON against the standard as you type and shows Valid JSON with counts of keys, objects, arrays and the nesting depth, or the first error with its line and column.
- Fix it
- Repairs only safe, mechanical mistakes (comments, single quotes, unquoted names, trailing commas) and lists what it changed.
- Warnings
- Flags duplicate names inside an object and numbers beyond what most software can store exactly.
- Open file, copy and download
- Load a .json file up to 5 MB from your device, then copy the result or download it as a .json file.
- JSON escape or unescape
- JSON escape turns text into a form you can paste inside a JSON string (quotes and line breaks escaped); JSON unescape turns an escaped string back into plain text.
What JSON is
JSON (JavaScript Object Notation) is a text format for structured data, defined by the IETF in RFC 8259. A JSON text is one value: an object of name/value pairs in curly braces, an array of values in square brackets, a string in double quotes, a number, or one of the literals true, false and null. Objects and arrays can nest inside each other to any depth.
Because JSON is plain text with a strict grammar, a single misplaced comma makes the whole file unreadable to a program. That is why a formatter that also validates is useful: it shows the structure and tells you exactly where the text breaks the rules.
Source: IETF RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format
Formatter, beautifier, validator, lint, checker: one page
- A JSON formatter or beautifier (sometimes called a JSON prettifier, or a tool to pretty print JSON) re-indents JSON so it is easy to read. To format JSON, paste it in: the Beautify output appears at once.
- A JSON validator, checker or linter tells you whether the text is valid JSON and, if not, where it fails. A JSON lint check and this validator check the same thing, the syntax, and this page runs it on every keystroke.
- A JSON minifier does the opposite of beautifying: the Minify output.
- A JSON viewer shows the structure; the tree view here lets you fold and unfold objects and arrays.
- A JSON parser reads the text into data. This page uses its own JSON parser, which follows RFC 8259 and keeps numbers exactly as written.
- Use it as a JSON formatter online or a JSON validator online: it works in any browser, and everything is processed on your device.
Common JSON errors and how to fix them
- Trailing comma: {"a": 1,} or [1, 2,]. JSON does not allow a comma after the last item. Remove it, or press Fix it.
- Single quotes: {'a': 'x'}. JSON strings and names need double quotes. Fix it converts them.
- Unquoted names: {a: 1}. Fine in JavaScript, not in JSON. Fix it adds the quotes.
- Comments: // and /* */ are not part of JSON. Fix it removes them.
- NaN, Infinity and undefined: not valid JSON values. Use null or a number.
- True, False, None, NULL: JSON literals are lowercase (true, false, null).
- Leading zeros: 07 is not a valid number. Write 7, or put a code like "07" in quotes.
- Line breaks inside a string: write \n instead of an actual new line.
- Missing comma between two values or properties: the error points at the second one.
- Two values one after the other, such as {} {}: wrap several values in one array.
Why your numbers stay exact
Most online formatters read JSON with the browser's JSON.parse, which stores every number as an IEEE 754 double. Large integers and some decimals change on the way: JSON.parse turns 12345678901234567890 into 12345678901234567000 and writes 1.0 back as 1. This tool reads JSON with its own parser and keeps each number exactly as you wrote it, so a database ID or a price keeps every digit.
RFC 8259 notes that integers in the range from -(2^53)+1 to (2^53)-1 are interoperable, and that numbers needing more precision may cause problems in other software. The validator warns you when a number goes beyond that, so you know to treat it as a string if another program will read it.
Duplicate names
RFC 8259 says the names within an object SHOULD be unique, and that when they are not, many implementations keep only the last value. A file with two "id" names in one object is technically readable but means different things to different programs, so the validator lists each duplicate with the line where the name first appeared.
Limits
- Up to 5 MB of JSON, checked in your browser. Colors are turned off above 200,000 characters of output to keep the page fast.
- It checks syntax against RFC 8259, not a JSON Schema: it tells you whether the JSON is well formed, not whether it has the fields an API expects.
- Fix it only repairs the mechanical mistakes listed above; it never guesses missing values or brackets.
- Up to 500 levels of nesting; deeper data stops with a clear error instead of freezing the page.
Questions
How do I validate JSON?
Paste it into the box. The tool checks it as you type and shows Valid JSON, or the first error with its line, column and a plain explanation.
How do I fix invalid JSON?
Read the error message and its hint, or press Fix it to repair trailing commas, single quotes, unquoted names and comments automatically. The tool lists what it changed.
What is the difference between beautify and minify?
Beautify adds line breaks and indentation so people can read the JSON. Minify removes them so the text is as small as possible for programs.
Why does JSON not allow trailing commas or comments?
The JSON grammar in RFC 8259 has no place for them: a comma must be followed by another value, and there is no comment syntax. JavaScript allows both, which is why they often slip in.
Will formatting change my data?
No. Only spacing changes. Names, strings and numbers are written exactly as in your input, including large numbers that many formatters would round.
Is my JSON uploaded anywhere?
No. It is parsed and formatted by JavaScript in your browser and is never sent to a server or stored.
More free tools
- Diff CheckerCompare two texts or files side by side, by line, word or character, and export the changes as a .diff.Use it
- Regex TesterTest a JavaScript regex live: highlighted matches, capture groups, replace, every flag and a plain-English explanation.Use it
- UUID GeneratorGenerate v4, v7 or v1 UUIDs in bulk, as GUIDs, URNs or a JSON array, and check any UUID's version and time.Use it
- Calcul âgeIn FrenchExact age calculator in French: years, months and days between a date of birth and any date.Use it
AI tools for the same job

CodeRabbit
Free trialFrom $30/moAI code reviews and agentic change management
Coding & Development
Qodo
Free trialUsage-based, from $0.015AI code review for agents, governance for humans.
Coding & Development
Amp
FreemiumFrom $20/moAmp is a coding agent and development environment built for the frontier.
Coding & Development