JSON formatter & validator (beautify, minify)
Format or minify JSON and find syntax errors by line and column. Sort keys, pick 2, 4 or tab indentation, copy or download. The JSON stays in your browser.
Runs on your deviceRuns entirely in your browser: nothing you type or upload leaves your device.
How to use it
- Paste your JSON.
- Press Format (with 2, 4 or tab indentation) or Minify; tick Sort keys to put them in alphabetical order.
- If it's invalid, fix the spot shown by the line, column and caret, then copy or download the result.
When JSON arrives as one unreadable line
APIs, webhooks, app logs and export files usually send JSON minified: everything on one line, no spaces. Formatting it with indentation shows the structure, so you can find the field you need, compare two responses or spot a missing value. Minify does the opposite before you paste JSON into a setting or a request.
When an integration fails with "invalid JSON", the validator gives the line and column of the first error and shows the 60 characters around it with a caret underneath, so you don't have to search a long line by eye.
Example: a balance written the Colombian way
Someone builds this by hand: {"cliente": "Pepito Pérez", "saldo": 1.200.000,50}. The tool answers ✗ Invalid JSON at line 1, column 43 and puts a caret under the second dot. JSON numbers can't have thousands separators, and the decimal separator is always a point, whatever the country. The right value is 1200000.50.
With that fixed, Format shows each field on its own line with 2, 4 or tab indentation, and Download saves it as formatted.json. Escaped letters are shown as real text: a name stored as Mu\u00f1oz appears as Muñoz, which is the same value written more readably.
What the validator can't catch
Valid doesn't mean correct. The tool checks the syntax, not whether the fields are the ones the other system expects, or whether a date is in the right format. If a key appears twice, JSON allows it but only the last value survives: {"nombre": "Muñoz", "nombre": "Pérez"} formats as just Pérez, without a warning.
Numbers that are really identifiers are another trap. A code like 05001, the DANE code for Medellín, is invalid as a number, because JSON numbers can't start with 0, and long account numbers can be rounded by programs that read them. Write them as text, in quotes. Sort keys uses plain character order, so capitals come before lowercase and keys with accents go after z.
FAQ
Does Sort keys change my data?
No value changes. Only the order of the keys inside each object changes, at every level, and JSON gives no meaning to that order. Arrays keep their order, because in an array the position is part of the data.
Will big numbers lose precision?
Not in browsers that support JSON source text access (recent Chrome, Edge and Firefox): numbers are kept exactly as written. Elsewhere, integers longer than 15 digits may be rounded, and the tool warns you when that could happen.
Why is my JSON invalid?
Usually one of four things: a comma after the last item, single quotes instead of double quotes, keys without quotes, or comments. JSON allows none of them, and the error position points at the first one.
Why is a file with one JSON object per line reported as invalid?
That format is called JSON Lines (or NDJSON), and logs and data exports use it a lot. Each line is valid JSON on its own, but together they are not one JSON document, so the tool stops at the start of line 2. Paste one line at a time, or put the lines inside [ ] separated by commas to turn them into a list.
How do I write decimals and money in JSON?
As plain numbers with a point and no separators: `1200000.50`, not `1.200.000,50` or `$1,200,000`. Many APIs prefer money as a whole number in cents or as a string, to avoid rounding; check what the receiving system's documentation asks for.
More in this chapter
- 5.2CSV to JSON converterConvert CSV to JSON or JSON to CSV with comma, semicolon or tab separators.
- 5.3YAML to JSON converterConvert YAML to JSON and back in your browser.
- 5.4Base64Encode or decode Base64 in your browser: UTF-8 text, URL-safe Base64, files to Base64 or data URLs, and Base64 back to a downloadable file.
- 5.5Color contrast checkerCheck the contrast ratio of a text color on its background against WCAG 2.2 AA and AAA, for normal text, large text and UI components.
- 5.6Cron explainerRead a 5-field cron expression as a plain sentence and see its next 5 run times in your time zone.
- 5.7Number base converterConvert whole numbers between decimal, hexadecimal, binary and octal, with bit length and grouped digits.
- 5.8HTML entity encoderEncode text as HTML entities (named, decimal or hex) or decode entities back to text: <, >, &, quotes, Spanish accents, Latin-1 symbols.
- 5.9URL encodePercent-encode or decode URLs and query values, and break any URL into protocol, host, path, query parameters and fragment.
- 5.10SHA-256 hashGet SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files and verify a download against its published checksum.
- 5.11UUID generatorGenerate random UUID v4 or time-ordered UUID v7 (RFC 9562) in your browser, 1 to 1000 at a time, in uppercase or without dashes.
- 5.12Unix timestampConvert Unix timestamps in seconds or milliseconds to ISO 8601, UTC and your local time, or a date back to epoch.
- 5.13JWT decoderDecode a JSON Web Token in your browser: see the header and payload as formatted JSON and whether it has expired.
- 5.14Regex testerTest regular expressions live: highlighted matches, capture and named groups, flags and clear errors.
╌╌ END ╌╌