Backslash Escape & Unescape
JSON Strings
Escape or unescape quotes, newlines, and tabs for JSON string values or general text. Live conversion in your browser.
This conversion runs only in your browser — nothing is uploaded.
JSON string escapes \ " \n \r \t only (no \'). General also escapes apostrophes and \0. Not a JSON document validator.
- Input0
- Output0
- OptionsJSON string
Input
Output
What is this tool?
This tool escapes special characters into visible backslash sequences, or turns those sequences back into real characters. Pick JSON string for values you will paste into JSON (and many config formats), or General text when you also need apostrophe (\') and null (\0) escapes.
It is not a JSON document validator and it does not implement every language’s escape grammar (regex, shell, SQL each differ). Use it to prepare a string literal, inspect logs, or undo accidental double-escaping.
Common use cases
- Insert a multi-line note or path with quotes into a JSON config field
- Clean log lines that show
\nand\"so you can read the original text - Prepare a string value for YAML/JSON settings without hand-editing escapes
How to use
- Choose Escape or Unescape. Results update live as you type.
- Select JSON string or General text — changing the option re-runs immediately.
- Paste plain text (escape) or an already-escaped string (unescape).
- Copy the output. Escape only once for the target format.
Examples
| Input / setting | Output | Notes |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | Double quotes for a JSON string value. |
It's ok → JSON Escape | It's ok | Apostrophe left alone (valid inside JSON "…"). |
It's ok → General Escape | It\'s ok | General also escapes '. |
line1 + newline + line2 → Escape | line1\nline2 | Newlines become \n. |
He said \\\"hi\\\" → Unescape once | He said \"hi\" | Over-escaped input; one Unescape peels one layer. |
Practical pitfalls
- Over-escaping: running Escape on text that is already escaped turns
\"into\\\", which breaks JSON parsers and config loaders. Unescape first, or paste the raw value once. - JSON string mode does not produce
\'. If a consumer rejects\', switch to JSON string instead of General. - This page does not validate full JSON documents, regex patterns, or shell quoting rules.
References
이 도구는 무엇인가요?
특수문자를 백슬래시 시퀀스로 바꾸거나, 시퀀스를 다시 문자로 되돌립니다. JSON/설정 파일에 넣을 값이면 JSON 문자열, 아포스트로피(\')·null(\0)까지 필요하면 일반 텍스트를 고르세요.
전체 JSON 문서 검증기가 아니며, 정규식·셸·SQL마다 규칙이 다릅니다. 문자열 리터럴 준비, 로그 확인, 이중 이스케이프 정리에 맞습니다.
자주 쓰는 경우
- 따옴표·여러 줄이 있는 메모를 JSON 설정 필드에 넣기
- 로그에 보이는
\n,\"를 원래 텍스트로 읽기 - YAML/JSON 설정 값용 문자열을 손으로 고치지 않고 준비
사용 방법
- Escape 또는 Unescape를 선택합니다. 입력하면 결과가 바로 갱신됩니다.
- JSON 문자열 / 일반 텍스트를 고릅니다. 옵션을 바꾸면 즉시 다시 변환됩니다.
- 평문(Escape) 또는 이미 이스케이프된 문자열(Unescape)을 붙여넣습니다.
- 결과를 복사합니다. 대상 형식에 맞게 한 번만 Escape하세요.
예시
| 입력 / 설정 | 출력 | 메모 |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | JSON 문자열용 큰따옴표 |
It's ok → JSON Escape | It's ok | JSON "…" 안에서는 ' 유지 |
It's ok → 일반 Escape | It\'s ok | 일반은 '도 이스케이프 |
| 개행 포함 두 줄 → Escape | line1\nline2 | 개행 → \n |
He said \\\"hi\\\" → Unescape 1회 | He said \"hi\" | 과잉 이스케이프 한 겹 제거 |
실무에서 흔한 실수
- 과잉 이스케이프: 이미 이스케이프된 값에 Escape를 다시 하면
\"가\\\"가 되어 JSON·설정 로더가 실패합니다. 먼저 Unescape하거나 원본만 한 번 Escape하세요. - JSON 문자열 모드는
\'를 만들지 않습니다. 파서가\'를 거부하면 일반 대신 JSON 문자열을 쓰세요. - 전체 JSON 검증·정규식·셸 인용 규칙은 다루하지 않습니다.
참고자료
このツールについて
特殊文字をバックスラッシュ列へ変換し、逆に元の文字へ戻します。JSON / 設定に貼る値なら JSON 文字列、アポストロフィ(\')や null(\0)も必要なら 一般テキスト を選びます。
JSON 文書全体の検証器ではなく、正規表現・シェル・SQL の規則とも一致しません。文字列リテラルの準備、ログ確認、二重エスケープの整理向けです。
よくある用途
- 引用符や複数行を含むメモを JSON 設定フィールドへ入れる
- ログ上の
\nや\"を元のテキストとして読む - YAML/JSON 設定用の文字列を手編集せず用意する
使い方
- Escape または Unescape を選びます。入力すると結果がすぐ更新されます。
- JSON 文字列 / 一般テキスト を選びます。変更するとすぐ再変換されます。
- 平文(Escape)または既にエスケープされた文字列(Unescape)を貼ります。
- 結果をコピーします。対象形式に合わせて一度だけ Escape してください。
例
| 入力 / 設定 | 出力 | メモ |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | JSON 文字列用の二重引用符 |
It's ok → JSON Escape | It's ok | JSON "…" 内では ' を維持 |
It's ok → 一般 Escape | It\'s ok | 一般は ' もエスケープ |
| 改行を含む2行 → Escape | line1\nline2 | 改行 → \n |
He said \\\"hi\\\" → Unescape 1回 | He said \"hi\" | 過剰エスケープを1層剥がす |
実務での落とし穴
- 過剰エスケープ: 既にエスケープ済みの値を再度 Escape すると
\"が\\\"になり、JSON / 設定ローダが失敗します。先に Unescape するか、生値を一度だけ Escape してください。 - JSON 文字列モードは
\'を出しません。パーサが\'を拒否する場合は一般ではなく JSON 文字列を使ってください。 - 文書全体の JSON 検証や正規表現・シェル引用は扱いません。
参考資料
¿Qué es esta herramienta?
Escapa caracteres especiales a secuencias con barra invertida, o las revierte a caracteres reales. Elige Cadena JSON para valores que pegarás en JSON (y muchos configs), o Texto general si también necesitas \' y \0.
No valida documentos JSON completos ni copia la gramática de regex, shell o SQL. Sirve para preparar literales, leer logs o deshacer doble escape.
Casos de uso comunes
- Insertar una nota multilínea con comillas en un campo de configuración JSON
- Limpiar líneas de log con
\ny\"para leer el texto original - Preparar valores de cadena para YAML/JSON sin editar escapes a mano
Cómo usar
- Elige Escape o Unescape. El resultado se actualiza al escribir.
- Selecciona Cadena JSON o Texto general — al cambiar la opción se reejecuta al instante.
- Pega texto plano (escape) o una cadena ya escapada (unescape).
- Copia la salida. Escapa solo una vez para el formato de destino.
Ejemplos
| Entrada / ajuste | Salida | Notas |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | Comillas dobles para valor JSON. |
It's ok → JSON Escape | It's ok | El apóstrofo se deja (válido en "…" JSON). |
It's ok → General Escape | It\'s ok | General también escapa '. |
| Dos líneas con salto → Escape | line1\nline2 | Saltos → \n. |
He said \\\"hi\\\" → Unescape 1× | He said \"hi\" | Quita una capa de sobre-escape. |
Errores prácticos
- Sobre-escape: Escape sobre texto ya escapado convierte
\"en\\\"y rompe parsers JSON. Unescape primero, o pega el valor crudo una sola vez. - El modo Cadena JSON no produce
\'. Si el consumidor rechaza\', usa Cadena JSON. - No valida JSON completo ni reglas de regex/shell.
Referencias
Qu'est-ce que cet outil ?
Échappe les caractères spéciaux en séquences antislash, ou les rétablit. Choisissez Chaîne JSON pour des valeurs à coller dans du JSON (et beaucoup de configs), ou Texte général si vous avez aussi besoin de \' et \0.
Ce n’est pas un validateur de document JSON ni la grammaire regex/shell/SQL. Utile pour préparer un littéral, lire des logs ou défaire un double échappement.
Cas d'usage courants
- Insérer une note multiligne avec guillemets dans un champ de config JSON
- Lire des logs qui affichent
\net\" - Préparer une valeur chaîne pour YAML/JSON sans éditer les escapes à la main
Comment utiliser
- Choisissez Escape ou Unescape. Le résultat se met à jour en direct.
- Sélectionnez Chaîne JSON ou Texte général — le changement relance tout de suite.
- Collez du texte brut (escape) ou une chaîne déjà échappée (unescape).
- Copiez la sortie. N’échappez qu’une fois pour le format cible.
Exemples
| Entrée / réglage | Sortie | Notes |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | Guillemets doubles pour une valeur JSON. |
It's ok → JSON Escape | It's ok | L’apostrophe reste (valide dans "…" JSON). |
It's ok → Général Escape | It\'s ok | Le mode général échappe aussi '. |
| Deux lignes → Escape | line1\nline2 | Sauts → \n. |
He said \\\"hi\\\" → Unescape 1× | He said \"hi\" | Retire une couche de sur-échappement. |
Pièges courants
- Sur-échappement : Escape sur du texte déjà échappé transforme
\"en\\\"et casse les parseurs JSON. Unescape d’abord, ou collez la valeur brute une seule fois. - Le mode Chaîne JSON ne produit pas
\'. Si le consommateur refuse\', utilisez Chaîne JSON. - Pas de validation JSON complète ni de règles regex/shell.
Références
这个工具是什么?
将特殊字符转成可见的反斜杠序列,或把序列还原为真实字符。粘贴进 JSON(及多数配置)时选 JSON 字符串;还需要撇号(\')和 null(\0)时选 普通文本。
它不是完整 JSON 校验器,也不等价于正则、Shell、SQL 的转义规则。适合准备字符串字面量、查看日志或去掉重复转义。
常见用途
- 把带引号的多行备注写入 JSON 配置字段
- 把日志里的
\n、\"还原成可读文本 - 为 YAML/JSON 配置准备字符串值,避免手写转义
如何使用
- 选择 Escape 或 Unescape。输入时结果即时更新。
- 选择 JSON 字符串 或 普通文本 — 切换选项会立即重新转换。
- 粘贴明文(Escape)或已转义字符串(Unescape)。
- 复制输出。按目标格式只 Escape 一次。
示例
| 输入 / 设置 | 输出 | 说明 |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | JSON 字符串值的双引号 |
It's ok → JSON Escape | It's ok | JSON "…" 内保留 ' |
It's ok → 普通 Escape | It\'s ok | 普通模式也转义 ' |
| 含换行的两行 → Escape | line1\nline2 | 换行 → \n |
He said \\\"hi\\\" → Unescape 一次 | He said \"hi\" | 去掉一层过度转义 |
实践中的常见误区
- 过度转义: 对已转义文本再 Escape,会把
\"变成\\\",导致 JSON/配置加载失败。先 Unescape,或只对原始值 Escape 一次。 - JSON 字符串模式不会产生
\'。若消费方拒绝\',请改用 JSON 字符串。 - 不校验完整 JSON 文档,也不覆盖正则/Shell 引号规则。
参考资料
這個工具是什麼?
將特殊字元轉成可見的反斜線序列,或把序列還原為真實字元。要貼進 JSON(及多數設定)時選 JSON 字串;還需要撇號(\')與 null(\0)時選 一般文字。
它不是完整 JSON 驗證器,也不等同正則、Shell、SQL 的跳脫規則。適合準備字串字面值、查看日誌或去掉重複跳脫。
常見用途
- 把含引號的多行備註寫入 JSON 設定欄位
- 把日誌裡的
\n、\"還原成可讀文字 - 為 YAML/JSON 設定準備字串值,避免手寫跳脫
如何使用
- 選擇 Escape 或 Unescape。輸入時結果即時更新。
- 選擇 JSON 字串 或 一般文字 — 切換選項會立刻重新轉換。
- 貼上明文(Escape)或已跳脫字串(Unescape)。
- 複製輸出。依目標格式只 Escape 一次。
範例
| 輸入 / 設定 | 輸出 | 說明 |
|---|---|---|
He said "hi" → JSON Escape | He said \"hi\" | JSON 字串值的雙引號 |
It's ok → JSON Escape | It's ok | JSON "…" 內保留 ' |
It's ok → 一般 Escape | It\'s ok | 一般模式也跳脫 ' |
| 含換行的兩行 → Escape | line1\nline2 | 換行 → \n |
He said \\\"hi\\\" → Unescape 一次 | He said \"hi\" | 去掉一層過度跳脫 |
實務上常見陷阱
- 過度跳脫: 對已跳脫文字再 Escape,會把
\"變成\\\",導致 JSON/設定載入失敗。先 Unescape,或只對原始值 Escape 一次。 - JSON 字串模式不會產生
\'。若消費端拒絕\',請改用 JSON 字串。 - 不驗證完整 JSON 文件,也不涵蓋正則/Shell 引號規則。
參考資料
Last reviewed: 2026-07-26
Frequently asked questions
- Is this a JSON validator?
- No. It only escapes or unescapes characters inside a string value. It does not parse objects, arrays, trailing commas, or full JSON documents—use a JSON formatter for that.
- What is the difference between JSON string and General text?
- JSON string escapes backslash, double quote, newline, carriage return, and tab. General text also escapes apostrophes as \' and null as \0, which many JSON parsers reject.
- Why did my string break after escaping twice?
- Each Escape pass turns an already-escaped sequence into another layer (for example \" becomes \\\"). Escape once for the target format, or Unescape before re-escaping.
- Does the text stay local?
- Yes. Escaping and unescaping run only in your browser; nothing is uploaded.