' occurrences in JavaScript so the code can be inlined in an HTML ' spelling is rewritten — look-alikes such as '' (with a space) pass through unescaped.","url":"https://uencoder.com/tools/html-encode-js","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"}} Skip to content
uencoder
TOOL

HTML Encode JS

Escape '</script>' occurrences in JavaScript so the code can be inlined in an HTML <script> block. Only the exact '</script>' spelling is rewritten — look-alikes such as '</script >' (with a space) pass through unescaped.

Try an example:
Local only

Recent history

No history yet

How to use

  1. Type or paste your input into the input box.
  2. Adjust any parameters if needed.
  3. Copy or download the result.

Frequently asked questions

Is my data uploaded anywhere?
No. All processing happens locally in your browser with no server round-trip.
Does this tool work offline?
Yes. Once the page loads, the tool runs entirely client-side and needs no network connection.

Related tools