Convert text to JavaScript readable


Skip navigation.

Site search

Site navigation

Script details

Use this to convert text into a variable

If you've ever tried to make some normal text containing characters like ' into a JavaScript variable, you will know how frustrating it can be when you miss one, or you miss a \ or a line break or a </script> tag. Well, let this script do it for you.

To see the script license and check details like browser compatibility, use the links on the navigation panel at the top of this page.

The output produced by this script should be usable in all JavaScript supporting browsers.


What type of quotes do you want to use:
HTML encoding:
  • [Info]

This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.