Online Java Escape & Unescape

Escapes the characters in a String using Java String rules. Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.).The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote and forward-slash (/) are escaped.

Here are some more details on the escape rules.

  • Backspace is exchanged for \b
  • Newline adopts the guise of \n
  • Tab transforms into \t
  • Carriage return dons the cloak of \r
  • Form feed assumes the identity of \f
  • Double quote takes on the visage of \"
  • Backslash adopts the semblance of \\