JSON
JSON Formatter / Minify / Validator
Formateo (sangría de 2 espacios), minificación y validación de JSON directamente en el navegador.
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
Artículo sobre esta herramienta: JSON Formatter: formatear, minificar y validar
Preguntas frecuentes
¿Cuál es la diferencia entre los modos Format y Minify?
Format añade una sangría de 2 espacios para que el JSON sea legible, mientras que Minify elimina todos los espacios innecesarios entre tokens para reducir el tamaño, sin tocar el contenido de los valores de texto.
¿Se envía el JSON que pego a algún servidor?
No, todo el procesamiento ocurre íntegramente en el navegador mediante JavaScript, no se sube nada a ningún servidor.
¿Por qué aparece un error si el JSON parece correcto?
Una causa habitual es una coma sobrante (trailing comma) antes del corchete de cierre, que no es válida según el estándar JSON aunque algunos lenguajes de programación sí la permitan.
¿En qué se diferencian JSON5 o JSONC del JSON estándar?
Son extensiones que además permiten comentarios, comas sobrantes y claves sin comillas. Un validador JSON estricto (como esta herramienta) rechazará correctamente ese texto — para procesarlo hace falta un analizador aparte que admita explícitamente JSON5/JSONC.
¿El formateo cambia los tipos de datos, por ejemplo los números?
No, formatear y minificar solo reorganizan los espacios y saltos de línea alrededor de los valores. Los números, cadenas, booleanos y null se mantienen exactamente como en el original.