[{"data":1,"prerenderedAt":53},["ShallowReactive",2],{"tool-guide:backslash-escape":3},{"overview":4,"whatIs":5,"useCases":6,"steps":12,"commonMistakes":17,"relatedStandards":23,"example":33,"limitations":37,"faq":40},"Backslash Escape & Unescape converts control characters and quotes to visible escape sequences or strictly decodes common slash, control, hexadecimal, and Unicode escapes.","Escape sequences represent characters that cannot be typed directly in source code or that have special meaning in a given context. The backslash (\\) is the universal escape character in most programming languages: \\n represents a newline, \\t a tab, \\\\ a literal backslash, and \\\" a double quote inside a double-quoted string. Beyond basic control characters, escape sequences can represent any Unicode code point: \\x41 is the hex representation of \"A\", \\u0041 is the Unicode escape, and \\u{1F600} represents the grinning face emoji. Working with escape sequences is a daily task when constructing JSON strings, writing regex patterns, building shell commands, or debugging log output that contains invisible characters. This tool operates in both directions: escape mode converts raw text (including invisible control characters) into visible escape sequences, and unescape mode decodes escape sequences back into the characters they represent. Both directions run locally in your browser.",[7,8,9,10,11],"Constructing JSON string values — escape special characters (newlines, tabs, quotes, backslashes) to embed raw text in valid JSON strings.","Debugging invisible characters — paste text that behaves unexpectedly to see hidden control characters (null bytes, carriage returns, zero-width spaces) as visible escape sequences.","Building regex patterns — escape metacharacters (., *, +, ?, (, )) that need to be matched literally in a regular expression.","Preparing shell arguments — escape special characters before passing strings to shell commands to prevent injection.","Decoding log output — unescape sequences in log files or API responses that display raw escape sequences instead of the actual characters.",[13,14,15,16],"Choose the direction: escape (raw text to escape sequences) or unescape (escape sequences to characters).","Paste the source string and run the transformation.","Review the output. In strict mode, incomplete or unsupported escape sequences are flagged as errors.","Copy the escaped or unescaped string for use in code or configuration.",[18,19,20,21,22],"Double-escaping — escaping an already-escaped string turns \\n into \\\\n. Apply escape\u002Funescape only once, not repeatedly.","Platform-specific line endings — Windows uses \\r\\n while Unix uses \\n. The tool shows both characters, helping you identify mixed line endings.","Confusing \\x and \\u escapes — \\x takes exactly 2 hex digits (\\x41 = A), \\u takes 4 hex digits (\\u0041 = A), and \\u{} takes 1-6 hex digits. The formats are not interchangeable.","JSON vs JavaScript escapes — JSON requires \\uNNNN for Unicode and does not support \\x or \\u{}. JavaScript supports all three forms.","Escape context matters — what needs escaping depends on the context (JSON string, regex, HTML attribute, URL). This tool handles the universal backslash convention.",[24,27,30],{"title":25,"url":26},"ECMAScript — String Literals","https:\u002F\u002Ftc39.es\u002Fecma262\u002Fmultipage\u002Fecmascript-language-lexical-grammar.html#sec-string-literals",{"title":28,"url":29},"RFC 8259 — JSON String Escaping","https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc8259#section-7",{"title":31,"url":32},"MDN — JavaScript escape notation","https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FLexical_grammar#escape_sequences",{"label":34,"input":35,"output":36},"Expose a newline and tab","first line followed by a newline and a tab","first line\\n\\tsecond field",[38,39],"This is a string escape utility, not a complete parser for a particular programming language literal.","Octal escapes, named Unicode escapes, and language-specific interpolation rules are not supported.",[41,44,47,50],{"question":42,"answer":43},"What escape sequences are supported?","Common backslash escapes (\\n, \\t, \\r, \\\\, \\\"), two-digit hex (\\xNN), and four\u002Fsix-digit Unicode (\\uNNNN, \\u{NNNNNN}) sequences.",{"question":45,"answer":46},"Can I escape text for use in JSON strings?","Yes. The escape mode converts control characters and quotes to their backslash-escaped form, suitable for embedding in JSON string values.",{"question":48,"answer":49},"Does this tool handle all programming languages?","It covers the most common escape conventions shared by JavaScript, Python, Java, C#, and Go. Language-specific features like octal escapes or template literals are not included.",{"question":51,"answer":52},"What is double-escaping and how do I avoid it?","Double-escaping turns \\n into \\\\n. It happens when you escape a string that already contains escape sequences. Always unescape first if the input may already be escaped.",1788868140175]