Formateur JSON
Format, validate, minify, and escape JSON with live syntax highlighting
100 % gratuit. Fonctionne entièrement dans votre navigateur : vos fichiers et données ne quittent jamais votre appareil et rien n'est envoyé à un serveur.
À propos de cet outil
JSON is the standard format for API responses and configuration files, and it is almost always delivered as a single unbroken line, because whitespace costs bandwidth and machines do not need it. Formatting adds indentation and line breaks so a human can actually read the structure; validating confirms the syntax is legal before you waste time debugging the wrong thing. The format itself is deliberately small: an object in curly braces with double-quoted keys, an array in square brackets, and six value types - string, number, boolean, null, object and array. That strictness is what makes JSON portable, and also what trips people up, because the rules are narrower than they look. Trailing commas are invalid. Keys must use double quotes, never single. Comments are not allowed at all. This tool formats, validates and minifies entirely in your browser, so API keys and customer records inside a payload never leave your machine.
Nettoyer et valider des données d'API
- 1Formater le JSONRendez-le lisible et repérez les erreurs de syntaxe.Vous êtes ici
- 2Convertir si nécessairePassez entre JSON, XML, YAML ou CSV.Ouvrir
- 3Comparer les versionsVoyez exactement ce qui a changé.Ouvrir
- 4Tester la requêteEnvoyez-la et inspectez la réponse.Ouvrir
Comment utiliser cet outil
- Paste your JSONDrop in the raw response or file contents. It does not matter whether it is minified or already indented.
- Format itThe structure is re-indented so nesting is visible at a glance, and the collapsible tree view lets you fold sections you are not interested in.
- Read any error reportedIf the syntax is invalid, the position of the problem is shown. That is normally within a character or two of the real mistake.
- Copy or minifyTake the formatted version for reading and debugging, or minify back to one line for production use where size matters.
Pourquoi l’utiliser
- Turns an unreadable single-line payload into something you can actually navigate.
- Validates syntax immediately, so you find the missing comma instead of guessing why an API call fails.
- Minifies as well as formats, so the same tool covers both debugging and shipping.
- Runs entirely in your browser - API keys, tokens and personal data in a payload are never transmitted.
- Handles large payloads without a size limit imposed by a server.
Usages courants
- Reading an API response while debugging an integration.
- Checking a package.json, tsconfig.json or CI configuration file before committing it.
- Validating a payload before sending it, to rule out syntax as the cause of a 400 error.
- Inspecting a webhook body that arrived as one long line in a log.
- Minifying a configuration file to reduce bundle size.
Conseils pour de meilleurs résultats
- Read the reported error position first. JSON parsers report where parsing became impossible, which is usually just after the actual mistake.
- A missing or extra comma is by far the most common error. Check the line above the one reported, not just the one named.
- If your JSON comes from JavaScript, keys may be unquoted or single-quoted - both are valid JavaScript and invalid JSON.
- For files that need comments, you probably want JSON5 or YAML. Standard JSON has no comment syntax and never will.
- Use the tree view for deeply nested data. Counting brackets by eye is what causes the mistakes in the first place.
Erreurs à éviter
- Leaving a trailing comma after the last item. Legal in JavaScript, illegal in JSON, and the single most common cause of parse failures.
- Using single quotes around keys or strings. JSON requires double quotes for both.
- Adding // or /* */ comments. JSON has no comment syntax, so any comment makes the whole document invalid.
- Writing NaN, Infinity or undefined as values. None of them exist in JSON - use null or a string.
- Wrapping numbers in quotes by accident, which turns 42 into the string "42" and breaks type checks downstream.
- Copying a JSON fragment out of a log that truncated it, then debugging syntax that was never complete.
Formats pris en charge
- JSON
Options disponibles
- Format
- Minify
- Validate
Questions fréquentes
Paste your JSON above and it is indented and validated immediately. Nesting becomes visible, the tree view lets you collapse sections, and any syntax error is reported with its position.
Yes - no account, no size cap and no paid tier. Everything runs locally in your browser.
No. Parsing, formatting and validation all happen in your browser using its own JSON engine. This matters because API payloads routinely contain tokens, keys and personal data - none of it is transmitted.
It is flagged as invalid with the position where parsing failed. Note that the real mistake is often slightly before that point - a missing comma at the end of one line is reported when the parser reaches the next.
Formatting adds indentation and line breaks for humans. Minifying strips every unnecessary character to make the payload as small as possible for transmission. The data is identical either way - only the whitespace differs.
The usual culprits are a trailing comma after the last element, single quotes instead of double, an unquoted key, or a comment. All four are valid JavaScript and none are valid JSON.
No. The specification has no comment syntax, so any // or /* */ makes the document invalid. If you need commented configuration, use JSON5, JSONC or YAML instead.
Six: string, number, boolean, null, object and array. There is no date type - dates are conventionally written as ISO 8601 strings - and no support for NaN, Infinity or undefined.
No. Only whitespace is added or removed. Keys, values, types and ordering are exactly as they were.
Yes, within your browser's memory. Multi-megabyte payloads format fine; extremely large files may be slow to render in the tree view simply because of how many nodes are drawn.
Les gens recherchent aussi
- json formatter online free
- json validator
- json beautifier
- json pretty print
- json minifier
- format json vscode
- why is my json invalid
- json viewer tree