Text Encoder and Decoder
Encode and decode URL, HTML, and Unicode text directly in your browser.
Use this tool from AI agents
This tool's engine is available to AI agents over MCP as encode_decode. Add the Clean.tools server, then your agent can call it directly.
claude mcp add --transport http clean-tools https://mcp.clean.tools/mcpclaude mcp add --transport http clean-tools https://mcp.clean.tools/mcp{"mcpServers":{"clean-tools":{"command":"npx","args":["-y","@clean-tools/mcp"]}}}{"mcpServers":{"clean-tools":{"command":"npx","args":["-y","@clean-tools/mcp"]}}}https://mcp.clean.tools/mcphttps://mcp.clean.tools/mcpOr call it over plain HTTP from any script. Same engine, JSON in and JSON out, no key:
curl -s https://api.clean.tools/v1/encode_decode \
-H 'content-type: application/json' \
-d '{"mode":"base64-encode","text":"Hello, world!"}'curl -s https://api.clean.tools/v1/encode_decode \
-H 'content-type: application/json' \
-d '{"mode":"base64-encode","text":"Hello, world!"}'const res = await fetch('https://api.clean.tools/v1/encode_decode', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ mode: 'base64-encode', text: 'Hello, world!' })
});
const data = await res.json();const res = await fetch('https://api.clean.tools/v1/encode_decode', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ mode: 'base64-encode', text: 'Hello, world!' })
});
const data = await res.json();How it works
This tool uses built-in browser functions for encoding and decoding text. URL mode uses encodeURIComponent and decodeURIComponent to handle percent-encoding for query strings and URLs. HTML mode replaces special characters like <, >, &, ", and ' with their HTML entities, and decodes them back to plain text.
All processing happens locally in your browser. No text is sent to any server. It works on any modern browser, on both mobile and desktop. No cost, no signup, no tracking.
Need the same conversions in a script or AI agent instead of the browser? The same engine is exposed as the encode_decode endpoint on the Clean.tools API, and you can install the @clean-tools/mcp package from npm to run it as a local MCP server.
Frequently asked questions
Why does URL Encode escape slashes and ampersands?
URL mode uses encodeURIComponent, which is built for a single URL component such as one query-string value. It intentionally escapes reserved characters like /, ?, &, and = so they cannot break the surrounding URL. If you paste a whole address you will see these get encoded too, which is expected.
What is the "Decode + as space" option for?
HTML form submissions encode spaces as + in the query string, but decodeURIComponent leaves + untouched and only decodes %20. Enable this toggle when decoding form-style data so plus signs turn back into spaces. Leave it off if your input contains literal plus signs you want to keep.
Does HTML Decode handle entities the encoder never produces?
Yes. HTML Encode only escapes the five characters &, <, >, ", and ', but HTML Decode uses the browser parser, so it also resolves named and numeric entities like ©, , and ©.
How are non-ASCII characters written in Unicode Escape mode?
Characters above U+007F become \u sequences: those in the Basic Multilingual Plane use four hex digits such as é, while astral characters like emoji use the brace form such as \u{1F600}. Unicode Unescape reads both forms back into the original text.
Can I use this from the command line or an AI agent?
Yes. Send a POST request to the REST endpoint at https://api.clean.tools/v1/encode_decode with a JSON body and you get the encoded or decoded result back as JSON. It is also an MCP server, so you can add it to Claude, Claude Code, or Cursor and let an agent call the tool directly. The @clean-tools/mcp npm package runs the same engine as a local stdio server if you would rather keep everything on your machine.
More tools from Clean.tools
Use Clean.tools from your AI agent
This tool is also encode_decode on the Clean.tools MCP server — the same engine, callable by your AI agent directly. No key, no signup: requests are processed in memory and request contents are never stored.
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcpclaude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcphttps://mcp.clean.tools/mcphttps://mcp.clean.tools/mcpEvery tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →