Free online JSON formatter and validator
JSON formatter that points at the typo
This JSON formatter is free, needs no signup, and re-indents a document the moment you paste it — 2 spaces, 4 spaces or a tab, with optional A–Z key sorting and a Minify switch that puts it all back on one line. It handles documents up to 5 MB, and when the JSON does not parse it names the line, the column and the reason rather than throwing “unexpected token” at you. Number literals, key order and duplicate keys come out exactly as they went in, because the parser works on the source text instead of converting it to JavaScript values first.
- 100% free
- No signup
- Up to 5 MB
- Sort keys A–Z
- Exact error line
The formatted result appears here.
Paste JSON, drop a file, or press Ctrl+V anywhere on this page.
All 65 tools
65 browser tools for the formats developers actually paste: JSON, XML, YAML, CSV, SQL, Markdown and base64. Formatting, validation, conversion, diffing, encoding and minification — every one of them free and open in one tab.
Format & beautify · 7 tools
- JSON FormatterIndent a payload with 2 spaces, 4 spaces or a tab, sort keys alphabetically, and get the line and column of the first syntax error.
- Prettify JSONExpand a one-line API response into a readable tree, keeping long integer IDs exactly as written instead of rounding them off.
- SQL FormatterBreak a wall-of-text query into aligned SELECT, JOIN and WHERE clauses with keywords cased the way your team writes them.
- HTML FormatterRe-indent markup while leaving pre, textarea and inline elements alone, so whitespace-sensitive tags render the same afterwards.
- YAML FormatterNormalise nesting to two spaces, line up mapping values and surface the tab characters YAML refuses to accept.
- JavaScript FormatterUnpack minified or hand-mangled JavaScript, splitting chained calls and statement blocks back onto lines you can read.
- CSS FormatterGive every declaration its own line and keep @media, @supports and nested rules indented by depth.
View & edit · 4 tools
- JSON ViewerBrowse a large document as a collapsible tree, open one branch at a time and copy the dot path of any value.
- JSON EditorEdit with validation running on every keystroke, so a stray comma is flagged on the line you typed it.
- XML ViewerExplore a document as a foldable element tree with attributes listed beside each node and namespace prefixes resolved.
- CSV ViewerLoad a delimited file into a sortable table, with the delimiter, quote character and header row detected from the first lines.
Encode & decode · 9 tools
- Base64 DecodeDecode a Base64 string back to text or a downloadable file, accepting the URL-safe alphabet and missing = padding.
- URL DecodeTurn %20, %C3%A9 and + back into the characters they stand for, one parameter or a whole query string at a time.
- Base64 EncodeEncode text or bytes to standard or URL-safe Base64, with optional line wrapping at the 76 characters MIME expects.
- URL EncodePercent-encode a value for a query parameter, a path segment or a full URL — each one escapes a different character set.
- Image To Base64Drop a PNG, JPEG, GIF, WebP or SVG and get the data: URI to paste straight into CSS or an img tag.
- Base64 To PDFRebuild a PDF from a Base64 blob, reporting its version, page count and page size so you know what you have before you save it.
- Escape JSONEscape quotes, backslashes, newlines and control characters so a block of text can live inside a JSON string value.
- HTML EncodeReplace angle brackets, ampersands and quotes with named entities, or switch to numeric references when the target encoding cannot carry them.
- File To Base64Convert any file up to 5 MB to Base64 and see the roughly 33% size penalty encoding adds before you embed it.
Compare · 5 tools
- Text CompareSet two blocks of text side by side and mark every added, removed and changed line between them.
- Diff CheckerSwitch between a unified patch and a two-column view, with word-level highlighting inside each changed line.
- Compare JSONMatch two documents by key instead of by line, so re-ordered properties stop showing up as differences.
- JSON DiffList the exact dot paths that were added, removed or changed between two payloads, with the old and new value beside each.
- Code DiffCompare two source files with whitespace-only and trailing-comma changes optionally ignored, so real edits stand out.
Dev utilities · 10 tools
- Lorem Ipsum GeneratorGenerate placeholder Latin by paragraph, sentence, word or list item, starting from the classic Lorem ipsum dolor sit amet.
- Epoch ConverterConvert an epoch value to a readable date in UTC and in your local zone, in seconds, milliseconds or microseconds.
- Hex To DecimalSwitch between hex and decimal with binary and octal alongside, including two's-complement for negative values.
- UUID GeneratorProduce v4 random or v7 time-ordered UUIDs in batches, seeded by the browser's crypto source rather than Math.random.
- Unix TimestampWatch the current timestamp tick every second and turn any calendar date into the epoch value it maps to.
- JWT DecoderSplit a token into header, payload and signature, decode both Base64url halves and show how long the exp claim has left.
- Regex TesterRun a JavaScript regular expression over sample text and see every match, capture group and named group it produced.
- Decimal To BinaryWrite a decimal number in binary with optional 8, 16 or 32-bit padding, and read the hex and octal forms of the same value.
- Timestamp ConverterMove a moment between ISO 8601, RFC 2822, epoch and any IANA time zone, daylight saving shifts included.
- Cron Expression GeneratorAssemble a cron expression field by field and read back the next five times it would fire.
Markdown · 7 tools
- Markdown EditorWrite with a live preview beside the source, covering GitHub-flavoured tables, task lists and fenced code blocks.
- Markdown PreviewPaste Markdown and read the rendered result the way GitHub would show it, footnotes and strikethrough included.
- PDF To MarkdownPull the text layer out of a PDF and rebuild its headings, lists and paragraphs as Markdown, page by page.
- Markdown To HTMLRender Markdown as clean semantic HTML with heading anchors, ready to drop into a template or a CMS field.
- Markdown Table GeneratorType or paste rows and get a padded Markdown table back, with alignment set per column.
- Table GeneratorBuild a table once in a grid and export it as Markdown, HTML, CSV, LaTeX or reStructuredText.
- HTML To MarkdownConvert pasted HTML into Markdown, mapping headings, links, lists and code blocks while dropping the wrapper divs.
Validate · 5 tools
- XML ValidatorCheck a document for well-formedness and get the error type, its line and column, and the source line that broke it.
- JSON To JSON SchemaInfer a draft 2020-12 JSON Schema from a sample payload, filling in types, required keys and enum candidates.
- YAML ValidatorParse YAML 1.2 and name the indentation, anchor or duplicate-key problem together with the line it sits on.
- JSON CheckerAnswer one question — is this valid JSON — and if the answer is no, point at the character that broke it.
- JSON Schema ValidatorValidate a document against a schema and list every failing keyword with the instance path it failed at.
Convert · 10 tools
- CSV To ExcelBuild an .xlsx workbook from delimited text with typed cells, so long numbers stop turning into scientific notation.
- XML To JSONTranslate elements, attributes and text nodes into JSON, choosing the attribute prefix and whether single children become arrays.
- CSV To JSONMap rows onto an array of objects using the header row as keys, handling quoted fields with commas inside them.
- Excel To CSVRead an .xlsx workbook in the browser and export any sheet as comma, semicolon or tab separated text.
- JSON To ExcelFlatten an array of objects into a spreadsheet, turning nested keys into dotted column headers.
- XML To CSVPick the repeating element and get one row per record, with child elements and attributes as columns.
- YAML To JSONResolve anchors, aliases and block scalars into plain JSON that a parser with no YAML support can read.
- JSON To YAMLRewrite JSON as YAML in block or flow style, quoting only the strings that would change meaning unquoted.
- JSON To XMLWrap a payload in XML elements, choosing the root name and the tag each array item is given.
- Excel To JSONTurn a worksheet into an array of objects, with dates converted from Excel serial numbers to ISO strings.
Reference · 5 tools
- ASCII TableAll 256 rows through Latin-1 with decimal, hex, octal, binary and HTML entity for each character, and the 33 control codes explained.
- HTTP Status CodesEvery status from 100 to 511 with its meaning, the RFC that defines it and when to send it instead of its neighbour.
- User Agent ParserBreak a User-Agent string into browser, engine, operating system and device — including the one you are reading this on.
- cURL ConverterPaste a curl command and get the same request written as fetch, Python requests, Node axios, Go or PowerShell.
- URL ParserSplit a URL into scheme, host, port, path, query parameters and fragment, decoding each piece as it goes.
Minify · 3 tools
- Minify JavaScriptStrip comments and whitespace from JavaScript and report how many bytes and what percentage the file lost.
- Minify JSONRemove every space and newline to reach the smallest valid payload for a request body or a config file.
- Minify CSSCollapse whitespace, drop comments and shorten hex colours without reordering a single selector.
How to format JSON
Three steps, a couple of seconds, no signup and nothing to install.
Paste or drop your JSON
Paste the document into the left panel, hit Ctrl+V — ⌘V on a Mac — without clicking into it first to pull a .json file off the clipboard, or drag one onto the editor. Anything up to 5 MB loads, including .geojson exports, .har network captures and lock files.
Pick an indent, or switch to Minify
Choose 2 spaces, 4 spaces or a tab and the right panel re-indents as you type. Tick “Sort keys A–Z” to order every object by key, recursively, so two payloads become comparable line by line. Minify does the reverse and returns the whole document on one line.
Copy or download the result
Copy puts the entire document on the clipboard even when the preview stops at 5,000 lines, and Download saves it as .json — or .min.json in minify mode. If the JSON does not parse, the bar underneath prints the line, the column, and a caret under the character at fault.
Technical specifications
| Accepted input | Any RFC 8259 document — an object, an array, or a bare string, number, true, false or null at the top level; .json, .geojson, .har, .webmanifest, .map and .txt files |
|---|---|
| Output | Indented with 2 spaces, 4 spaces or a tab, or minified onto a single line |
| Maximum document size | 5 MB (5,242,880 bytes) — a 5 MB array of 36,000 records re-indents in about 0.3 seconds and minifies in about 0.2 |
| Error reporting | Line, column, the cause in plain English, and a caret under the offending character |
| Kept exactly as written | Number literals including 20-digit IDs, duplicate keys, key order, and \uXXXX escapes inside strings |
| Key sorting | Optional and recursive, by UTF-16 code point — the ordering jq -S produces |
| Nesting limit | 500 levels, past which no mainstream JSON parser will accept the document |
| Processing location | Your browser — the document is never uploaded to a server |
| Price | Free, no signup, no limit on the number of documents |
Frequently asked questions
How do I format JSON online?
Paste the document into the left panel and the indented version appears on the right straight away. Pick 2-space, 4-space or tab indentation in the toolbar, then press Copy or Download. There is nothing to install and no account to create.
Is this JSON formatter free?
Yes, and there is no paid tier to run into: no signup, no daily quota, no cap on how many documents you format, and nothing appended to the output. The only limit is 5 MB per document.
What does “Unexpected token” in JSON mean?
It means the parser hit a character that cannot legally appear where it found it, and the usual culprits are five: a trailing comma before } or ], single quotes instead of double quotes, an unquoted property name copied out of JavaScript, a // or /* comment, and NaN or undefined where a value belongs. This page names the cause instead — “Trailing comma: JSON does not allow a comma before the closing }” — with the line, the column and a caret under the character.
Why do other formatters change my large ID numbers?
Because they run the document through JSON.parse, where every number becomes a 64-bit float, and integers above 9,007,199,254,740,991 cannot be represented exactly — 9007199254740993 comes back as ...92, and 1.500 comes back as 1.5. This formatter keeps every number as the text you typed, so Twitter-style snowflake IDs, order numbers and fixed-decimal prices come out byte for byte the way they went in.
Can I sort JSON keys alphabetically?
Yes — tick “Sort keys A–Z” and every object in the document is sorted, not just the top level. Sorting compares UTF-16 code points, the same ordering jq -S uses, which puts uppercase letters before lowercase ones and digits before both. Sorting two payloads the same way before diffing them removes the false differences that come from key order alone.
What is the largest JSON file this can format?
5 MB per document, which is roughly 36,000 records of typical API shape. A 5 MB array re-indents in about 0.3 seconds on an average laptop, and the preview pane stops drawing at 5,000 lines while Copy and Download still hand you the whole thing. Above 5 MB the tool asks you to split the array rather than freezing the tab.
Is my JSON uploaded to a server?
No. The parser and the printer are JavaScript running inside your own tab, so the document never leaves the machine. A side effect worth knowing: once this page has loaded, formatting keeps working with the network switched off.
About formatting JSON
Formatting JSON looks like a whitespace problem and is really a parsing problem. A tool that indents with regular expressions will happily pretty-print a document that no parser accepts, which is the worst possible outcome: the payload now looks correct and still breaks in production. Everything here goes through a real parser first, so a document that renders on the right is a document that will parse anywhere — the same check the JSON checker performs when validation is all you need.
The reason this page keeps the source text of every value is that the obvious implementation, JSON.parse followed by JSON.stringify, quietly rewrites three things. Numbers become 64-bit floats, so a 19-digit ID loses its last digits and 1.500 becomes 1.5. Duplicate keys collapse to the last one, even though RFC 8259 only says names should be unique. And any key that looks like a non-negative integer jumps to the front in numeric order, because that is how JavaScript objects store properties — feed {"10":"a","2":"b"} through that round trip and the keys come back swapped. Members are held in an array here, in the order you wrote them, so re-indenting a document changes its layout and nothing else.
In practice formatting is the first half of a job and something else is the second. Indent a webhook payload to read it, then sort both sides before you compare two JSON documents so that re-ordered properties stop registering as changes. Paste a config file, fix the comma the caret is pointing at, then minify it — a document indented with two spaces is around 35% larger than the same data on one line, which is worth reclaiming in a request body or an environment variable.
Where your JSON is processed
Everything happens in the browser tab you are reading this in. The document you paste is parsed and re-printed by JavaScript on your own machine and is never uploaded, logged or stored — which is also why the formatter keeps working after you disconnect from the internet, and why closing the tab is enough to be rid of the payload.