Toolvist

Escapado y stringify de texto

Escapa comillas, barras invertidas y caracteres especiales para producir un literal de JavaScript o JSON seguro. Escapador de texto online con resultados al instante.

Herramienta de escape de cadenas gratuita

La herramienta de escape de cadenas escapa comillas, barras invertidas y caracteres especiales para que el texto se pueda incrustar de forma segura en código JavaScript, JSON o C#. También puede revertir el proceso para desescapar una cadena.

The decoded form is read with the Unicode to Text Converter, and the other escape conventions are covered by the URL Encoder & Decoder and HTML Entity Encoder & Decoder. For the encodings rather than escapes, the Base64 to Hex Converter is the sibling.

Cómo usar Escapado de texto

  1. 1 Paste your text.
  2. 2 Choose the target language or format.
  3. 3 Convert. The result is the same text with the correct quoting and escaping for that context.
  4. 4 Copy the escaped string.

Cómo usarlo

Pega tu texto, elige un lenguaje de destino y un modo, y el resultado escapado aparece al instante. Cambia a Desescapar para convertir las secuencias de escape de nuevo en caracteres reales.

  • Escape para JavaScript, JSON o C#
  • Maneja comillas, barras invertidas, saltos de línea, tabs
  • Comillas externas opcionales y modo JSON.stringify
  • El modo Desescapar revierte la operación
  • Se ejecuta enteramente en tu navegador

Preguntas frecuentes

What does escaping actually protect against?

Ambiguity. A string that contains the quote character used to delimit it is syntactically broken unless the inner character is escaped. Similarly, a string containing a backslash, a newline or a control character has to be represented in a way the parser can read back unambiguously.

Why does the output differ between languages?

Because each language has its own escape vocabulary. JSON and JavaScript share most of theirs, but a language with different string delimiters or different support for interpolation needs a different approach. Converting across languages means matching the target's rules, not applying one universal escaping.

Should I escape for HTML the same way?

No, and this is a common and dangerous confusion. HTML escaping prevents markup injection; string escaping prevents syntax errors. Applying one where the other is needed produces code that either breaks or, worse, appears to work while leaving an injection point open.

Herramientas para desarrolladores relacionadas

Ver todo en Herramientas para desarrolladores →