Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

JSON5 to JSON Converter & Validator

Paste JSON5 or JSON with comments (JSONC, like tsconfig.json or VS Code settings) and get strict, valid JSON. Comments, trailing commas, single-quoted strings, unquoted keys, hex numbers and Infinity are handled — with the exact line and column of any error.

Atualizado em
Special numbers

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: JSON5 to JSON Converter

  1. Paste JSON5, JSONC or any “relaxed” JSON on the left.
  2. Strict JSON appears on the right; errors show the exact line and column.
  3. Choose the indent, and how Infinity and NaN (not allowed in JSON) are written.
  4. Copy the JSON.

JSON5 and JSONC vs. JSON

Allowed in JSON5ExampleStrict JSON
Comments// note, /* … */removed
Trailing commas[1, 2,][1, 2]
Unquoted keys{ name: "x" }{ "name": "x" }
Single quotes'text'"text"
Hex, leading dot, plus sign0xFF, .5, +1255, 0.5, 1
Infinity, NaNInfinitynull (or a string)
Multi-line stringsbackslash at line endone line

JSONC (“JSON with comments”) is the format of tsconfig.json, VS Code and many editor settings: JSON plus comments and, often, trailing commas. JSON5 goes further. Both are great for hand-written config — but APIs, databases and JSON.parse need strict JSON.

Next steps: format and validate JSON, or convert it to YAML or TOML.

Também pesquisado como: json5 to json, jsonc to json, json with comments, json5 parser, json5 validator, remove comments from json, trailing comma json, tsconfig to json.

Ferramentas que combinam com: JSON5 to JSON Converter

  • JSON Validator — Paste JSON to check whether it is valid.
  • JSONL Converter — Turn JSON Lines (JSONL / NDJSON — one JSON object per line, as used by logs, BigQuery, OpenAI fine-tuning and data exports) into a JSON array, or an array back into JSONL.
  • JSON Schema to TypeScript — Paste a JSON Schema (draft-07 or 2020-12) and get TypeScript interfaces — required and optional properties, enums as union types, oneOf/anyOf as unions, allOf as intersections, $ref definitions as named types and descriptions as JSDoc comments.
  • JSON Minifier — Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.

Perguntas frequentes

How do I remove comments from JSON?
Paste the JSON with comments here — the output is the same data as strict JSON, with every // and /* */ comment and trailing comma removed.
What is the difference between JSON5 and JSONC?
JSONC is JSON plus comments (and usually trailing commas), used by tsconfig.json and VS Code. JSON5 also allows unquoted keys, single quotes, hex numbers, Infinity and more.
What happens to Infinity and NaN?
Strict JSON has no Infinity or NaN, so they become null (like JSON.stringify does) or, if you choose, strings.
Is my data uploaded?
No. Parsing happens entirely in your browser.
Posso instalar o JSON5 to JSON Converter como um aplicativo da web e usá-lo offline?
Sim. O JSON5 to JSON Converter é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas