Advertisement
Developer Tools

JSON Formatter and Validator

Paste JSON or upload a file to beautify, minify or validate it. Errors are reported with the exact line and column, common mistakes can be fixed automatically, and you can convert the result to CSV or YAML in one click.

  • Exact error line and column
  • Fix trailing commas and comments
  • JSON to CSV and YAML
  • Duplicate key warnings
  • Up to 2 MB
Up to 2 MB. Processed in memory, never stored.
Advertisement
How to use

How to use the JSON formatter

  1. 1

    Paste or upload

    Paste JSON into the box or choose a .json file up to 2 MB.

  2. 2

    Pick a mode

    Beautify for readable output, Minify for the smallest size, Validate to check only, or convert to CSV or YAML.

  3. 3

    Set options

    Choose 2, 3 or 4 spaces or tabs, sort keys, escape non-ASCII, or tick Fix common errors.

  4. 4

    Copy or download

    Copy the result or download it as a file. Errors point to the exact character that broke parsing.

JSON formatter online

A JSON formatter and validator in one

This JSON formatter online takes compact, single-line JSON from an API response, a log file or a config export and turns it into neatly indented text you can actually read. It is also a strict JSON validator: the input is parsed character by character against RFC 8259, the official JSON standard, so anything that would be rejected by JSON.parse() in JavaScript, json.loads() in Python or json_decode() in PHP is rejected here too.

When something is wrong, you get a plain-English message, the line and column number, and a caret under the character that broke parsing. That is much faster than reading "Unexpected token" and hunting through 2,000 lines by eye.

Beautify, pretty print and minify

  • Beautify (often called pretty JSON or JSON pretty print) adds line breaks and indentation. Pick 2 spaces (the common default for JavaScript and web APIs), 3, 4 spaces (Python style) or tabs.
  • Minify strips every unnecessary space and line break. Use it before embedding JSON in a URL, an HTML attribute, an environment variable or a request body where size matters.
  • Validate only checks the input and shows statistics: number of objects, arrays, keys and the maximum nesting depth.

Numbers are re-emitted exactly as you wrote them. A value like 12345678901234567890 or 1.10 is kept as is, while many browser-based formatters silently round large integers because JavaScript numbers are 64-bit floats.

Fix JSON errors

Common JSON errors and how to fix them

Most invalid JSON comes from a handful of mistakes. Tick Fix common errors and the formatter repairs the first three automatically, outside string values only, and tells you what it changed.

ErrorExampleFix
Trailing comma{"a": 1,}Remove the last comma before } or ].
Comments// note or /* note */JSON has no comments. Remove them or move notes into a field.
Single quotes{'a': 'b'}Strings and keys must use double quotes.
Unquoted keys{a: 1}Wrap every key in double quotes.
Raw line breaks in stringsa string split over two linesUse \n inside the string.
NaN, undefined, Infinity{"x": NaN}Not valid JSON. Use null or a string.

The validator also warns about duplicate keys. They are technically allowed by the grammar, but parsers disagree on which value wins, so a duplicate is usually a bug.

Advertisement
JSON to CSV and YAML

Convert JSON to CSV or YAML

The JSON to CSV mode turns an array of objects into a spreadsheet-ready table. Nested objects are flattened into dot-notation columns, so {"user": {"name": "Ana"}} becomes a column called user.name. If your JSON is a single object that wraps one array (a common API shape like {"results": [...]}), the array is used as the rows. Choose a semicolon delimiter for Excel in European locales or tab for TSV.

For the reverse direction, or for CSV with type detection and custom delimiters, use the CSV to JSON converter.

The JSON to YAML mode outputs YAML 1.2, the format used by Kubernetes manifests, GitHub Actions, Docker Compose and many CI tools. Strings that YAML would misread, such as yes, no, on or values starting with a digit, are quoted so the meaning does not change.

Escape and unescape JSON strings

Need to put a block of JSON inside another JSON string, a log line or a test fixture? Escape string wraps the input in quotes and escapes quotes, backslashes and line breaks. Unescape string does the opposite and turns "{\"a\":1}" back into {"a":1}.

Developer notes

How this JSON validator works

Instead of relying on a generic error from the language runtime, BulkMaker uses its own RFC 8259 parser that records the byte offset of every token. That is what makes the exact line and column possible, and it also means formatting is lossless: key order, number spelling and Unicode text are preserved unless you ask to sort keys or escape non-ASCII characters.

  • Sort keys A to Z makes two JSON documents easy to compare. Format both with sorted keys, then paste them into the text compare tool for a clean diff.
  • Escape non-ASCII converts characters like é or emoji to é style escapes, which is useful for systems that only accept 7-bit ASCII.
  • Your JSON is processed in memory for one request and is not logged or stored. Even so, remove API keys and personal data before pasting into any online tool.
FAQ

JSON Formatter: frequently asked questions

What does a JSON formatter do?

A JSON formatter adds consistent indentation and line breaks to JSON so it is easy to read, and can also minify it back to a single line. This one also validates the JSON and shows the exact line and column of any error.

How do I validate JSON online?

Paste your JSON, choose the Validate tab and click Format JSON. You will see either a Valid JSON message with statistics, or the error message with the line, column and a pointer to the problem character.

Why is my JSON invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, comments, and values like NaN or undefined. Tick Fix common errors to repair trailing commas, comments and single quotes automatically.

What is the difference between beautify and minify?

Beautify adds indentation and line breaks for people to read. Minify removes all optional whitespace to make the JSON as small as possible for machines and network transfer. Both contain exactly the same data.

Can I convert JSON to CSV with this JSON formatter?

Yes. Choose the JSON to CSV tab. An array of objects becomes rows, nested objects become dot-notation columns, and you can pick comma, semicolon or tab as the delimiter.

Does the formatter change my numbers or key order?

No. Numbers are kept exactly as written, including very large integers and trailing zeros, and keys stay in their original order unless you tick Sort keys A to Z.

Is there a size limit?

You can paste or upload up to 2 MB of JSON per request, which covers most API responses and config files.

Is my JSON data stored?

No. The JSON is processed in memory to build the response and is not written to disk, logged or shared.

About Developer Tools

More about our developer tools

Everyday developer utilities for working with JSON, CSV, Base64, URL encoding, hashes and UUIDs. Every tool runs the conversion on our server with PHP's own standard functions, json_decode, base64_encode, hash(), random_bytes, so the output matches what your own code would produce.

Why server-side developer tools?

Many online formatters run a JavaScript library in your browser that behaves slightly differently from the language you actually deploy. BulkMaker runs PHP's native implementations, which follow the same RFCs (RFC 8259 for JSON, RFC 4648 for Base64, RFC 3986 for URL encoding, RFC 4122 for UUIDs) that every mainstream language implements.

Bulk by default

Each developer tool accepts many values at once, one per line, so you can hash a column of IDs, decode a list of Base64 strings, or generate 500 UUIDs in one go instead of pasting them one at a time.

Privacy and secrets

Input is processed in memory for a single request and never written to disk or a database. Even so, avoid pasting production secrets, private keys or live passwords into any online tool, rotate any credential that has been pasted somewhere you do not control.