Does it use \u00xx for non-ASCII?
No — non-ASCII characters are passed through unchanged because Java source files are compiled with a configurable encoding (UTF-8 by default in modern toolchains) and accept literal Unicode in string literals. If your build pipeline forces ASCII-only source, you can replace each non-ASCII character with its \u00xx escape after the basic escape pass — but that requirement is rare on modern projects.
What about modified UTF-8?
Modified UTF-8 is the encoding the JVM uses internally for class-file constants — it differs from standard UTF-8 in how it encodes the null character and supplementary code points. It is purely an internal detail; it does not change how you write Java source. The escape transformation here produces a valid Java source-level string literal regardless of the modified-UTF-8 wire format used inside the class file.
Do I need to escape single quotes in Java strings?
No. Inside a double-quoted string, the single quote is just an ordinary character. You only need to escape it (\') inside char literals ('a', '\''). The tool follows that rule and leaves single quotes alone in string output.
How does this compare with text blocks (Java 15+)?
Java 15 introduced text blocks (triple-quoted, """...""") which preserve newlines and quotes literally with much less escaping. If your target is Java 15 or later, paste raw multi-line content into a text block and skip the escape pass entirely. This tool produces a single-line traditional string literal — useful for older code, code-generation, and cases where you cannot use text blocks.
Can I use it for Java .properties files?
Almost. .properties files share the backslash escapes but additionally require escaping leading whitespace, the equals sign in keys, and use \u00xx for any character outside ISO-8859-1. The basic escapes here are correct, but for full .properties output you would add those rules. Modern projects often switch to UTF-8 .properties (Java 9+) which avoids most of the extra encoding.
What about Kotlin and Scala?
Kotlin and Scala both follow Java's escape conventions for traditional double-quoted strings, so the output of this tool is also valid Kotlin and Scala. Each language adds its own raw or interpolated string variants (Kotlin's """, Scala's s"...") that change the rules; for those, escape requirements differ.
Why is the backslash escaped first?
Order matters. If quote escaping ran first, the resulting \" would itself contain a backslash that the next pass would re-escape into \\". Doubling backslashes first is the only way to guarantee no double-encoding occurs in any character.
Is the input sent to a server?
No. The escape transformation runs entirely in JavaScript inside your browser. Java source often contains SQL templates, secrets, or business-logic constants — none of it leaves the device. Verify in the browser DevTools Network tab.