Skip to content

JSON Formatter

Runs in your browser

Paste, drop a file, pick your indentation. It re-formats as you type.

Input

Valid JSON

Output

Statistics

Size

629 B

Objects

7

Arrays

2

Keys

33

Max depth

4

Primitives

30

Primitive breakdown

  • string20
  • number7
  • boolean1
  • null2

Largest branches (approximate)

  • $.items204 B
  • $.customer160 B
  • $.customer.address84 B
  • $.items[0]73 B
  • $.metadata71 B

How this one works

Paste into the left panel, or drag a .json file straight onto it. It re-parses as you type, so the formatted version on the right is always in sync. Pick the indentation you like, flip to Minify when you need it on one line, then copy or download. If the document won't parse, you get the line and column of the problem.

Questions

Does any of this reach a server?

No. The parser is plain JavaScript running in your tab. There's no backend to send anything to. You can open your network tab and check that nothing you paste is ever sent, or pull the plug and keep working offline.

Why does it reject my trailing commas and comments?

Because they aren't JSON. They're perfectly normal in a JavaScript object literal, and in JSON5 or JSONC, but the actual JSON grammar (RFC 8259) has no room for either, and neither does JSON.parse or the API you're probably about to send this to. Better to find out here than in a 400 response.

Format or minify: which do I want?

Format when a human has to read it: indentation and line breaks, easy to scan. Minify when a machine has to read it: every optional space stripped out, which is what you want going over the wire. Same data either way, so it's purely about who's reading.

Keyboard shortcuts

Global

  • Show this shortcuts dialogShift?
  • Toggle light / dark themeCtrlShiftL
  • Close dialogsEsc

Formatter & Validator

  • Format JSONCtrlEnter
  • Minify JSONCtrlShiftM
  • Copy outputCtrlShiftC
  • Download output as .jsonCtrlShiftS
  • Clear input and outputCtrlShiftX

Tree Viewer

  • Focus the search box/
  • Expand all nodesCtrlShiftE
  • Collapse all nodesCtrlShiftR

Diff

  • Swap document A and BCtrlShiftS

Time & date tools

  • Use the current time (Epoch Converter)CtrlEnter
  • Copy the main resultCtrlShiftC
  • Clear the inputCtrlShiftX

PHP Unserialize & Serialize

  • Convert an input over 2 MBCtrlEnter
  • Copy outputCtrlShiftC
  • Download outputCtrlShiftS
  • Clear input and outputCtrlShiftX

Keys & IDs

  • Generate a new token or UUID batchCtrlEnter
  • Copy the resultCtrlShiftC

JSON tools

JSON FormatterPretty-print or minify
JSON ValidatorCheck strict JSON validity
JSON Tree ViewerBrowse JSON as a tree
JSON DiffCompare two documents
JSON Path FinderExplore JSONPath expressions
JSON to CSVFlatten JSON into rows
CSV to JSONTurn rows back into objects
PHP UnserializeSerialized PHP to JSON
PHP SerializeJSON to serialized PHP

JWT tools

JWT DecoderClaims, signature and expiry
JWT VerifierWith a secret, PEM key or JWKS
JWT Expiry Checkeriat, nbf and exp in local time
JWT GeneratorBuild a signed test token
Base64URL EncoderEncode or decode a segment

Time & date tools

Epoch ConverterTimestamps to real dates
Cron Expression ExplainerCron in plain English
Time Zone ConverterOne moment, many cities
Duration CalculatorDate maths and durations

Keys & IDs

Password GeneratorSecure random secrets
UUID Generatorv1, v4, v5 or v7 UUIDs

Code formatters

SQL FormatterBeautify or minify SQL
HTML FormatterBeautify or minify HTML
CSS FormatterBeautify or minify CSS
JavaScript FormatterBeautify or minify JS
PHP FormatterBeautify PHP code
Markdown to HTMLConvert with a live preview

AI tools

Token CounterTokens for every model
Prompt Secret ScrubberHide keys and personal data

Pages

JSON toolsFormat, validate, compare and convert JSON.
JWT toolsDecode, verify and generate JSON Web Tokens.
Time & date toolsConvert timestamps, read cron, compare zones.
Keys & IDsGenerate secure tokens, passwords and UUIDs.
Code formattersFormat SQL, HTML, CSS, JavaScript and PHP code.
AI toolsCount tokens and hide secrets before you prompt.
HomePopular tools and categories
All categoriesBrowse tools by category
AboutWhat ToolJar is and why
PrivacyWhat is and is not collected

Theme

Switch to light theme
Switch to dark theme