Skip to content
PrivBay

JSON formatter and validator

Make JSON readable, check its syntax or remove whitespace. Parsing and formatting happen in your browser.

Ready. Your JSON stays on this device.

Very large numbers can lose precision, and duplicate keys keep the last value. Put exact IDs in quotes.

How to format and validate JSON

  1. Paste JSON into the input field.
  2. Choose two spaces, four spaces or tabs, then select Format and validate.
  3. Fix any reported syntax error, or select Minify for compact output.
  4. Copy the formatted result or download it as a JSON file.

Format or minify JSON

Formatting adds indentation and line breaks without changing the parsed data. Minifying removes unnecessary whitespace for a compact representation. A successful parse confirms JSON syntax; it does not validate against a JSON Schema or check business rules.

The tool uses the browser’s JSON parser. Number precision, duplicate keys and property ordering follow JavaScript rules, so keep a copy of the original when working with exact financial values or identifiers.

When to format and when to minify

Format JSON when you need to read it: an API response, a log entry or a configuration file that arrived as one long line. Indentation makes the structure and any nesting easier to follow. Choose two spaces, four spaces or tabs to match your project.

Minify JSON when it will be read by a program and size matters, such as data sent in a request or stored in a file. The data stays the same, only the whitespace changes. If you are creating test credentials for a project, the password generator runs locally too. To check the length of a text value, use the word counter. To see the address your connection uses, try my IP address.

If the JSON came from a percent-encoded query parameter, use the URL decoder first. Use the regex tester to try a JavaScript pattern against a sample of text.

Use the SQL formatter for database queries and the Code diff checker to review changes between two versions of a source file.

To change formats, use the JSON converter for YAML, TOML, XML and CSV.

Use the formatter to beautify or pretty print compact JSON. Use validation to lint its syntax.

To inspect the encoded header and claims of a compact token, open the JWT decoder.

Frequently asked questions

What JSON syntax is accepted?

Standard JSON only: double-quoted keys and strings, no comments, trailing commas, undefined or NaN. Error details are supplied by your browser and may include a line or character position.

Can large numbers change?

Yes. JavaScript numbers can lose precision, particularly integers beyond 9,007,199,254,740,991. Put exact large IDs in quoted strings. Duplicate object keys keep their last value.

Is there an input limit?

The input is limited to 2 million characters to keep the page responsive. For larger documents, use a dedicated local editor.

What are the most common JSON errors?

Trailing commas, single quotes, unquoted keys and comments are all invalid in standard JSON. Use double quotes for keys and strings, and remove any comma after the last item in a list or object.

Is my JSON sent anywhere?

No. Your browser parses and formats it on your device. This makes the tool a better fit for API responses and configuration files that may contain private values.

Last updated November 11, 2026