Toolivaro

Minificador de JSON gratis

Comprime JSON a su forma válida más pequeña: elimina todo el espacio en blanco, cuenta los bytes ahorrados y copia o descarga el resultado.

El minificador de JSON reduce un documento JSON a su representación válida más pequeña, eliminando cada byte de espacio en blanco insignificante sin alterar los datos. Pega JSON formateado o con sangría, y la herramienta devuelve la forma compacta con la entrada, la salida y el ahorro en bytes y porcentaje —los números que importan cuando estás recortando un archivo de configuración, una carga de API o un blob almacenado. El resultado se genera analizando y volviendo a serializar, así que la salida minimizada está garantizada como válida y semánticamente idéntica a la entrada: los mismos datos, el mismo orden de claves, los mismos números. Las acciones de copiar y descargar facilitan meter el resultado en código o en un archivo. Todo se ejecuta localmente en tu navegador: el JSON pegado nunca sale de tu dispositivo, no se registra ni se transmite —esencial para tokens y configuraciones que no deben filtrarse. Usa esta herramienta antes de hacer commit de una configuración, para reducir cargas incrustadas o cuando una API o una cuota de almacenamiento cuente bytes.

Se procesa localmente en tu navegador

Procesado localmente en tu navegador: el JSON pegado nunca se sube, registra ni almacena.

Cómo usar esta calculadora

What minification does — and what it does not touch

Minification removes every byte of whitespace between JSON tokens: the indentation, the line breaks, the padding after colons and commas that a formatter added. Whitespace outside string values is insignificant in JSON, so removing it changes nothing about the data — the same values, the same keys, the same order — while making the document as small as the format allows. The tool parses and re-serializes the document rather than editing text, so the output is guaranteed to be valid JSON and semantically identical to the input: the minifier cannot corrupt a document the way a text-based find-and-replace could.

That guarantee is the reason to prefer parse-and-stringify over a clever regex: number representation is preserved, key order is preserved, and the result is always a document the platform can parse again. The savings panel reports input bytes, output bytes, and the percentage saved, so the decision to ship the minified form is made on real numbers.

Where the bytes actually matter

Minification pays off wherever JSON crosses a boundary with a cost: an embedded config in a shipped product (the saving multiplies across every device and every fetch), a payload measured against an API quota, a stored blob billed by size, or a fixture committed to a repository where every byte stays in history. The worked example is typical: a 412-byte pretty-printed config minifies to 301 bytes — 27% smaller, with the same data.

The honest counter-case is also worth knowing: if the input is already compact, re-serialization can add a few bytes (re-escaping a character, for instance), and the tool reports a negative saving rather than hiding it. Minification is a formatting choice with measurable results, and the panel shows the true number in both directions.

The format that travels well

A minified document is still valid JSON, so it can be formatted back to readable indentation at any time — formatting and minifying are exact inverses for valid documents, which is why the JSON formatter and minifier are linked pages. The compact form is also the better base for a second, independent compression step: transport compression (gzip, brotli) works on the bytes after minification, and starting from the smallest valid form means the transport layer has less redundancy to remove.

The two caveats are worth keeping: minification removes whitespace only — it does not rename keys, strip comments (JSON has none), or compress values — and very large documents take a moment to process, so the tool is designed for typical configs and payloads rather than database dumps.

The local promise

Config files and payloads often contain tokens, internal endpoints, and other text that must not leak, and minifying is a job no service needs to see. Everything runs in your browser: the document is parsed and serialized locally, nothing is uploaded, logged, or stored, and copy and download actions deliver the result wherever it is needed.

¿Cómo se calcula el resultado?

Recortar un archivo de configuración con sangría

Una configuración con sangría pesa 412 bytes en 14 líneas; su forma minimizada ocupa 301 bytes: un 27 % menos. Para una configuración enviada a miles de dispositivos, ese ahorro se multiplica en cada instalación y en cada descarga. El resultado minimizado sigue siendo JSON válido y se puede volver a formatear en cualquier momento con el formateador de JSON.

Entrada y resultado del ejemplo
Entrada Valor
json { "retries": 3, "timeoutMs": 5000, "features": { "cache": true } }
Resultado 412 B → 301 B (−27 %) · JSON válido · datos idénticos

¿Cuál es la fórmula y sus supuestos?

Método de minimización

minify(json) = JSON.stringify(parse(json))

Términos de la fórmula
Símbolo Significado
parse analizador JSON estándar
stringify serialización sin espacio en blanco

El espacio en blanco fuera de las cadenas es insignificante en JSON, así que eliminarlo nunca cambia los datos.

Ahorro de tamaño

savings % = (input bytes − output bytes) / input bytes × 100

Términos de la fórmula
Símbolo Significado
input bytes tamaño UTF-8 del documento de entrada
output bytes tamaño UTF-8 del documento minimizado

¿Cuáles son los errores más comunes?

  • Minimizar JSON que no es válido de entrada: la herramienta valida antes de comprimir e informa del problema exacto.
  • Suponer que la minimización encoge todos los documentos; las entradas ya compactas pueden crecer unos pocos bytes.
  • Usar un minificador en línea que sube el documento: esta herramienta mantiene todo en tu dispositivo.

¿Cuáles son los supuestos y las limitaciones?

  • La minimización solo elimina espacio en blanco; las claves, los valores y la estructura se conservan tal cual.
  • Los documentos muy grandes pueden tardar un momento; la herramienta está pensada para configuraciones y cargas típicas.
  • La salida usa serialización compacta; la compresión tipo gzip del resultado es un paso aparte.

¿De dónde salen los números?

Última revisión 4 de agosto de 2026 · Versión 1.0.0 · Toolivaro no garantiza el contenido externo.

Preguntas frecuentes

¿La minimización cambia mis datos?

No. El minificador analiza y vuelve a serializar el documento, lo que preserva exactamente los valores, el orden de las claves y la representación de los números. El espacio en blanco entre tokens es insignificante en JSON, así que eliminarlo no tiene pérdidas.

¿Por qué a veces mi salida minimizada es más grande?

Si la entrada ya es compacta, volver a serializarla puede añadir unos pocos bytes (por ejemplo, al volver a escapar caracteres). El porcentaje de ahorro puede ser negativo en esas entradas: la herramienta informa de las cifras reales en lugar de ocultarlas.

¿El JSON minimizado se puede volver a formatear?

Sí: la forma minimizada es JSON válido, así que el formateador de JSON restaura la sangría legible en cualquier momento. Formatear y minimizar son operaciones inversas exactas para documentos válidos.

Does the minifier remove comments?

JSON has no comments — a document containing them is not valid JSON and is rejected with the parser’s error. Files like tsconfig or package.json use JSONC or JSON5 variants that allow comments; those are outside the JSON standard this tool follows.

Why is the savings percentage negative sometimes?

When the input is already compact, re-serialization can add a few bytes — for example re-escaping a character or normalizing a number’s formatting. The tool reports the true change rather than a floor of zero.

Parte de Kit de herramientas de texto y JSON para desarrolladores

¿Encontraste un error o tienes una corrección? Repórtalo: revisamos cada corrección.

¿Te ha sido útil?

Revisado por el equipo editorial de Toolivaro según nuestra metodología Metodología · Política editorial