fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/developer-tools/json-formatter

{ JSON formatter }

Format, beautify and validate JSON with configurable indentation. Find syntax errors by exact position and copy clean JSON: processed in your browser, kept on your device.

format_indent_increaseBeautifyruleValidatecompressMinify
indent
2 spaces4 spacesTab
data_objectSamplebug_reportBroken sample
format_indent_increaseFormatcompressMinifycontent_copyCopyClear
input.json1 lines · 256 B
formatted.json31 lines · 428 B · 167% of input
1{
2 "user": {
3 "id": 4821,
4 "name": "Ada Lovelace",
5 "roles": [
6 "admin",
7 "editor"
8 ],
9 "active": true,
10 "lastLogin": null
11 },
12 "settings": {
13 "theme": "dark",
14 "notifications": {
15 "email": true,
16 "push": false
17 }
18 },
19 "items": [
20 {
21 "sku": "FF-01",
22 "qty": 2,
23 "price": 19.99
24 },
25 {
26 "sku": "FF-02",
27 "qty": 1,
28 "price": 4.5
29 }
30 ]
31}
errorInvalid JSON
line 0column 0position 0
lightbulb
data_objectformatted output appears here
valid JSON · 18 keys · depth 3shield_lockprocessed locally · nothing sent
~/use-cases

When you'll reach for it.

From a raw API response to a config file that's about to go to production.

apidebug
Debug API responses
Paste a raw response to see its structure instantly. Malformed data from external APIs is flagged right away.
rocket_launchvalidate
Validate before deployment
Invalid JSON in config files causes silent failures. Check syntax before it reaches production.
compressminify
Minify for production
Strip whitespace to shrink API payloads and stored config: typically 30-50% smaller, no data lost.
comparecompare
Compare structures
Format two objects separately; indentation makes nested keys and array depth obvious side by side.
settingsconfig
Check configuration files
One missing comma can break a config. A quick validation catches it before it crashes anything.
schoollearn
Learn JSON structure
Indentation levels show exactly how deep nesting goes and which keys belong to which object.
lockprivate
Safe for sensitive data
Formatting runs locally in your browser. Tokens, payloads and internal data stay on your device.
databasestore
Prepare for storage or transfer
Format first to verify validity, then minify before saving to a database or sending over the network.
~/format-vs-minify

Formatting vs minification.

Same data, different purpose. Format first to verify it's valid, then minify for production.

Aspect
format_indent_increaseFormatted
compressMinified
Whitespace
Indented, with line breaks between elements
All non-essential whitespace removed
File size
Larger: typically 2-3× bigger
Smallest possible size, saves bandwidth
Readability
Highly readable, shows structure clearly
Difficult for humans to read
Use case
Debugging, documentation, code review, learning
Production APIs, stored data, config files
Processing speed
Parses as fast as minified
Slightly faster network transfer
Data integrity
Values unchanged: only whitespace added
Values unchanged: only whitespace removed
~/fix-errors

How to validate and fix JSON errors.

content_paste01
Paste and read the status
Paste your JSON. The tool shows success or an error immediately: errors include the exact character position.
Unexpected token } in JSON at position 245
my_location02
Jump to the position
Use Go to Line (usually Ctrl+G) in your editor. Look for missing commas, unescaped quotes, trailing commas, mismatched brackets or single-quoted keys.
line 3 · column 34
task_alt03
Fix and retest
Paste the corrected JSON back in. Once it validates, Format to check the structure with proper indentation.
✓ valid JSON

Common problems

Error: “Unexpected token ' in JSON”{'name':'John'}{"name":"John"}
buildJSON requires double quotes around every key and string value: single quotes aren’t valid. Search for single quotes and replace them. This is the most common JSON error.
Error: “Unexpected token undefined”[1,2,3,][1,2,3]
buildUsually a trailing comma after the last item in an array or object. Remove the comma before the closing bracket or brace.
Success, but the output is empty
buildYou probably pasted an empty string or only whitespace. There’s nothing to format: paste your actual JSON and try again.
Large files format slowly or freeze the browser
buildFiles over about 50 MB can overwhelm browser memory. Split the JSON into smaller chunks, or use a desktop editor built for large data.
~/valid-but-different

Valid JSON that two programs read differently.

RFC 8259 leaves several things to the implementation: how big a number can be, what happens to a repeated key, whether a broken Unicode escape is allowed. A payload can pass every validator and still mean different things in JavaScript, Python and Go. The JavaScript column below is computed live by this browser’s own JSON.parse.

Large integersprecisionDuplicate keysambiguousLone surrogateunicodeNegative zeronumbersHuge exponentnumbersByte order markencodingA bare stringtop levelNaNnot JSON
input, exactly as received{"id": 9007199254740993}UTF-8: 7B 22 69 64 22 3A 20 39 30 30 37 31 39 39 …
what the standard saysNumbers have no size limit in the grammar. RFC 8259 warns that values outside ±(2^53 − 1) may not be exact, because many parsers use IEEE 754 doubles.
parserreads it aswrites it back as
JavaScriptJSON.parse · this browser{"id":9007199254740992}{"id":9007199254740992}
Python 3json.loads9007199254740993 (int){"id": 9007199254740993}
Goencoding/json → any9007199254740992 (float64){"id":9007199254740992}
shieldSend IDs and money as strings, or parse with BigInt-aware readers. Twitter’s API added id_str for exactly this reason.
~/escapes

Which characters a JSON string has to escape.

Only three kinds are mandatory: the double quote, the backslash and the 32 control characters below U+0020. Everything else, including emoji, may appear as it is in UTF-8. Some encoders escape all non-ASCII anyway (Python’s default ensure_ascii=True), and characters beyond U+FFFF then become a pair of \u escapes. Type anything to see it encoded.

Raw UTF-8ASCII only (\u)
T-U+0054a-U+0061b-U+0062␉\tU+0009h-U+0068e-U+0065r-U+0072e-U+0065␣-U+0020"\"U+0022q-U+0071u-U+0075o-U+006Ft-U+0074e-U+0065d-U+0064"\"U+0022␣-U+0020C-U+0043:-U+003A\\\U+005C␣-U+0020c-U+0063a-U+0061f-U+0066é-U+00E9␣-U+0020😀-U+1F600
encoded JSON string28 chars → 38 bytes"Tab\there \"quoted\" C:\\ café 😀"
" and \Always escaped, as \" and \\.control U+0000-001FMust be escaped. Tab, newline and five others have short forms like \t; the rest use \u00XX.other non-ASCIIAllowed as-is in UTF-8. ASCII-only output turns é into \u00e9.beyond U+FFFFEmoji and rare scripts. Escaped, they need a surrogate pair: 😀 is \ud83d\ude00.
~/spec-sheet

JSON, for reference.

Two documents define JSON and agree on the grammar: ECMA-404 and IETF RFC 8259, which adds the interoperability rules. Around them sits a family of stricter, looser and line-based variants.

Full nameJavaScript Object NotationSpecified by Douglas Crockford in the early 2000s
Extension.json.jsonl or .ndjson for one value per line
MIME typeapplication/jsonNo charset parameter: UTF-8 is implied; +json suffix for derived types
Apple UTIpublic.jsonUniform Type Identifier on macOS and iOS
StandardsECMA-404 · RFC 8259 · STD 90ECMA-404 2nd edition and RFC 8259 both published December 2017
EncodingUTF-8 onlyRequired for JSON exchanged between systems; no BOM
Value typesobject · array · string · number · true · false · nullNo dates, binary, comments, NaN or Infinity
Whitespacespace · tab · LF · CROnly these four, and only between tokens
Numbers-?int(.frac)?(e±exp)?No leading zeros, no leading +, no hex, no trailing dot
Top levelany valueSince RFC 7159; RFC 4627 allowed only an object or array
Strict profileI-JSON · RFC 7493No duplicate keys, no lone surrogates, numbers within double precision
Magic bytesnoneUsually starts with 7B “{” or 5B “[”, after optional whitespace
variantdifference from JSONdefined by
JSON5Comments, trailing commas, single quotes, unquoted keys, hex, Infinityjson5.org
JSONCJSON plus comments, used by VS Code settings and tsconfigMicrosoft
JSON LinesOne complete JSON value per line, for logs and streamsjsonlines.org
JSON-seqRecords prefixed with the RS control characterRFC 7464
JSON-LDOrdinary JSON with @context keys that link dataW3C
GeoJSONFixed shapes for points, lines and polygonsRFC 7946
JSON SchemaJSON that describes and validates other JSONjson-schema.org
2001First JSON messageCrockford and colleagues send JSON between browser and server at State Software.
2002json.orgThe grammar is published as railroad diagrams that still define it.
2006RFC 4627application/json is registered; top level must be an object or array.
2013ECMA-404Ecma publishes a short, syntax-only standard.
2014RFC 7159Any value allowed at the top level; interoperability advice added.
2017RFC 8259Becomes Internet Standard 90 and makes UTF-8 mandatory.
2019JSON ⊂ ECMAScriptES2019 lets U+2028 and U+2029 appear in string literals, so every JSON text is valid JavaScript.

Frequently Asked Questions

How do I format and beautify JSON?

Paste or type your JSON into the tool and it instantly reformats it with clean indentation and line breaks so nested structures are easy to read. You can adjust the indentation and copy the beautified result. Everything runs in your browser, so your data never leaves your device.

Does the JSON formatter validate my JSON?

Yes. As it formats, the tool checks that your JSON is well formed and points out errors such as missing commas or brackets, so you can fix invalid data quickly before using it in your code.

Is the JSON formatter free and private?

Yes, it is completely free with no signup or limit. Because formatting happens locally in your browser, your JSON is never uploaded to a server, which makes it safe for sensitive or internal data.

Can I minify JSON as well as beautify it?

The formatter is built to make JSON readable with configurable indentation. You can beautify messy or minified JSON into a clean, structured layout that is easy to scan and debug.