Encoding / Escape
Pick the format you need. JSON, URL, or HTML escaping each live on their own page.
Escape a string for a JSON literal.
Percent-encode a string for a URL.
Encode characters for safe HTML output.