gptcleanuppro.com / url-encode-decode
Ready · local0w
Works with text copied from
ChatGPTClaudeGeminiGrokCopilotPerplexity
bytes sent to a server
0
words altered
0
length or run limit
None

The tool

A single input that determines its own direction

This tool accepts one input rather than separate encode and decode fields. Plain text is percent-encoded, converting characters unsafe in a URL, spaces, ampersands, question marks, into percent-encoded bytes. Text already containing a valid percent-encoded sequence, such as %20, is decoded back into readable form instead.

Processing runs client-side, in JavaScript, entirely within your browser. There is no upload and no server round trip, and accordingly no run limit.

The problem

Why certain characters cannot appear unescaped in a URL

A URL permits a limited safe character set unescaped: letters, digits, and a small number of punctuation marks. Any other character, a space, an ampersand, a question mark within a value, a non-ASCII character, must be represented as a percent sign followed by two hexadecimal digits, or it risks being interpreted as structural syntax rather than data.

This is most consequential within a query parameter: a search term containing a space, an email address used as a value, a title containing an ampersand, all require encoding before they can safely traverse a link.

How it works

How to encode or decode a URL in three steps

A single field, with direction determined automatically.

Step 1
Paste the text or URL component into the input field.
Step 2
Run the conversion. Already percent-encoded input is decoded; other input is encoded.
Step 3
Read the result.

Specification

What precisely is encoded, and what is left alone

Letters, digits and a small set of characters designated safe are returned unchanged. Every other character, spaces, ampersands, question marks, colons, slashes, and accented or non-Latin characters, is converted to one or more percent-encoded bytes.

A space becomes %20. An ampersand becomes %26. A character outside the ASCII range is represented across multiple percent-encoded bytes, since it occupies more than one byte in its underlying encoding.

Consequences

What an unencoded value breaks in practice

An unencoded ampersand within a query parameter's value is interpreted as the start of the subsequent parameter, silently corrupting the data. A literal space can invalidate a URL outright, since raw spaces are not permitted within one.

Decoding presents a distinct failure mode: a percent sign not followed by two valid hexadecimal digits cannot be safely decoded and produces an explicit error rather than an incorrect guess.

Mechanism

How the tool determines whether to encode or decode

It searches for a percent sign followed by two hexadecimal digits, a pattern exclusive to already-encoded text. When found, the input is decoded; otherwise, it is treated as plain text and encoded.

A coincidental percent-digit sequence within plain text could be misinterpreted as encoded, so an unexpected result warrants checking the input for this case.

A value that mixes encoded and unencoded segments, part of a string already percent-encoded and part still plain, is decoded as one unit rather than segment by segment, since the direction check runs once against the whole input. A coincidental percent-hex pattern inside an otherwise plain string can trigger a decode nobody intended, which is worth checking for if a result looks wrong.

The boundary

Why percent-encoding is not the same as sanitizing a value

Percent-encoding solves exactly one problem: making a value safe to sit inside a URL. It does nothing for a value destined elsewhere. A string safely percent-encoded for a query parameter is not automatically safe to insert into HTML, where an ampersand or an angle bracket needs its own distinct escaping, or into a SQL query, where an entirely different set of characters carries meaning unrelated to URL structure.

Treating a percent-encoded value as sanitized for any context beyond the URL itself is a common and consequential mistake. Each destination, a URL, an HTML document, a SQL statement, a shell command, has its own syntax and its own escaping rules, and encoding for one does not carry protection into another.

Who it's for

Who uses a URL encoder and decoder, and when

Engineers construct a query string by encoding a search term or redirect URL before embedding it in a link, and decode a URL retrieved from server logs or a browser address bar back into readable form.

Anyone diagnosing a malfunctioning link with unexpected characters uses this to determine precisely what a percent-encoded sequence represents, rather than inferring it from raw bytes.

FAQ

URL encoder and decoder, answered precisely

All answered in full, nothing to click open.

How do I encode a URL or query parameter?

Paste the plain text into the input field and run the conversion.

How do I decode a percent-encoded URL?

Paste the encoded text and run the conversion.

Is this tool free?

Yes. No length cap and no run limit, since processing happens on your own device.

Is my text uploaded anywhere?

Not by this tool. Processing runs entirely client-side.

How is the direction determined?

The tool checks for a percent sign followed by two hexadecimal digits, a pattern exclusive to already-encoded text.

What happens with an invalid percent-encoded input?

An explicit error is returned rather than an incorrect guess, since a malformed sequence cannot be safely decoded.

Is a space encoded as %20 or a plus sign?

As %20, the standard percent-encoding for a URL component.

Are letters and digits encoded?

No, letters, digits and a small set of safe characters are returned unchanged.

Are accented letters and non-Latin scripts handled correctly?

Yes, converted to one or more percent-encoded bytes.

Can an entire URL, including slashes, be encoded?

It can, but doing so also encodes the slashes and colon, typically invalidating the URL's structure.

Are already-safe characters altered?

No, only characters outside the safe set are converted.

Is there a limit on input length?

No length cap and no run limit.

Does it work on mobile devices?

Yes, the layout adapts and conversion runs identically on mobile.

Is there a batch mode or an API?

Not currently. This is a single-input, browser-based tool.

Is it suitable for a URL containing sensitive data?

Yes, nothing leaves the browser and nothing is retained.

Why does decoding return the same text that was entered?

No valid percent-encoded sequence was present, so consider whether encoding was the intended operation.

Does this also remove hidden Unicode characters?

No, that is handled separately by the AI watermark remover.

What happens with a value that mixes encoded and unencoded segments?

The whole input is decoded as one unit if it contains a valid percent-encoded sequence, rather than segment by segment, so check the result against what was expected.

Does encoding a value make it safe to insert into HTML?

No. Percent-encoding solves the URL's own syntax problem only. HTML has separate characters, like an ampersand or an angle bracket, that need their own escaping regardless of URL encoding.

Does encoding protect against a SQL injection if the value goes into a database query?

No. Percent-encoding has nothing to do with SQL syntax. A value must be handled with parameterized queries or the database driver's own escaping, independent of any URL encoding applied to it.

Is a percent-encoded value generally safe to treat as sanitized?

No, only for the specific context of sitting inside a URL. Each destination a value travels to afterward has its own rules and needs its own handling.

Encode or decode, direction detected automatically.

Computed locally, no upload, no run limit.

Open the tool