Uniform Resource Locator (URL) Encoder
Percent-encode URL components, full links, form values, and paths, then audit escapes with a character map and QR-ready handoff.{{ summaryTitle }}
{{ mainOutput }}
| # | Input | Class | UTF-8 bytes | Encoded | Copy |
|---|---|---|---|---|---|
| {{ row.idx }} | {{ row.charDisplay }} | {{ row.classLabel }} | {{ row.utf8 }} | {{ row.encodedDisplay }} |
| Key | Decoded value | Copy |
|---|---|---|
| {{ row.key }} | {{ row.value }} | |
| No query parameters | ||
Introduction:
URL text has two jobs at the same time. Some characters are ordinary data, such as the words in a search term. Other characters are syntax, such as the slash that separates path segments, the question mark that starts a query, the ampersand that often separates query pairs, and the hash that starts a fragment. Percent-encoding is the escape system that lets data contain spaces, symbols, or non-ASCII text without accidentally changing that structure.
The percent sign is followed by two hexadecimal digits that represent one byte. A space commonly becomes %20, an ampersand used as data becomes %26, and non-ASCII text is first represented as UTF-8 bytes before each byte is escaped. That byte-based rule is why é becomes %C3%A9 rather than a single escape for the visible letter.
- Reserved characters
- Characters such as
:,/,?,#,&, and=can act as URL delimiters. - Unreserved characters
- Letters, digits, hyphen, period, underscore, and tilde can usually stay readable in a URI.
- Component
- One part of a URL, such as a query value, path segment, fragment value, or other field where delimiter characters may need to be treated as data.
| Context | What usually stays readable | Common mistake |
|---|---|---|
| Whole URL | Scheme, host, path separators, query separators, and fragment marker. | Treating a query value as a whole URL and leaving & or = with structural meaning. |
| Single component | Only characters that are safe inside one component. | Leaving a slash or ampersand unescaped when it should be literal data. |
| Form-style query value | Spaces may be represented with +. |
Using + where the receiver expects a literal plus sign or a normal %20 space. |
| Path text | Slash separators when they are meant to divide path segments. | Escaping every slash and turning a multi-segment path into one segment. |
Unicode adds another source of surprise. Two strings can look alike while using different underlying code points, and Unicode normalization can make some equivalent forms compare the same before encoding. Compatibility normalization can also change characters that are visually or semantically distinct, so it should not be applied casually to identifiers, signed links, or test data where byte identity matters.
Percent-encoding prepares text for placement in a URL. It does not prove that the destination is safe, that a server will parse repeated query keys in a particular way, or that a displayed browser address is exactly the same byte sequence another system will receive.
How to Use This Tool:
Choose the target before judging the output. The same pasted text can be correct in one URL position and wrong in another.
- Paste the source value into
Text or URL. The summary appears only after the trimmed or untrimmed source text has content. - Set
Encoding targettoURL componentfor a value that will be inserted into a query, fragment, token, or similar single component. - Use
Full URLwhen the pasted value already includes URL structure that should remain intact. UsePath with slasheswhen slash characters should remain path separators. - Choose
Form/query valueonly when the receiving parser expects spaces as+. Otherwise, keep normal percent-encoded spaces. - Open
Advancedwhen exact handoff matters.Strict RFC 3986 escapesescapes!,',(,), and*;Preserve existing %XX escapesprevents valid existing triplets such as%2Ffrom becoming%252F. - Use
Character Mapto audit each character, its class, UTF-8 bytes, and encoded form. UseQuery Previewwhen the encoded output parses as a URL with query parameters. - Copy
Encoded URL Textfor the final value. IfOpen URLis disabled, the output did not parse as an HTTP or HTTPS URL that can be opened directly.
Interpreting Results:
The summary shows the current target, output length, percent-escape count, and space policy. A larger escape count usually means more reserved characters, spaces, Unicode bytes, or strict-mode escapes. It does not mean the output is more correct by itself.
Encoded URL Text is the value to copy into another address, request, document, QR code, or test case. Character Map is the audit trail for why individual characters changed. The map is especially useful when a slash, ampersand, percent sign, emoji, accent, line break, or tab produced an unexpected result.
Query Preview decodes query parameters from a URL-shaped output so you can spot whether a value split into multiple keys or stayed inside one value. Treat URL ready and Open URL as parse checks, not safety checks. A syntactically openable URL can still point to the wrong destination or be interpreted differently by the receiving server.
QR Handoff is practical for short outputs only. When the QR surface is unavailable or the output is too long to scan reliably, copy the text output and test it in the destination that will consume it.
Technical Details:
URI syntax is built around character sets with different roles. Unreserved characters can appear directly because they have no delimiter role in the generic syntax. Reserved characters are allowed in URLs, but their meaning depends on where they appear. Encoding a reserved character can change URL interpretation, and decoding an escaped reserved character can do the same.
Percent-encoding works on bytes, not abstract letters. Text outside the ASCII range is represented as UTF-8, then each byte that cannot remain visible is written as % plus two hexadecimal digits. Hex digit case is equivalent for URI comparison, but uppercase escapes are the conventional normalized form.
Transformation Core
The main decision is not whether text is "URL encoded" in the abstract. The decision is which URL context the text will occupy.
| Target | Transformation behavior | Example effect |
|---|---|---|
| URL component | Escapes reserved delimiters so the value can occupy one component. | tea/milk becomes tea%2Fmilk. |
| Full URL | Keeps URL delimiters that define scheme, host, path, query, and fragment structure. | https://example.com/a b?q=x keeps ://, /, ?, and =. |
| Form/query value | Escapes the value like a component, then represents spaces with +. |
tea milk becomes tea+milk. |
| Path with slashes | Escapes unsafe path content while keeping slash characters visible. | docs/team notes becomes docs/team%20notes. |
Length and Escape Counts
Each kept byte contributes one visible character to the encoded output. Each escaped byte contributes three visible characters. A space represented as + contributes one visible character even though a space represented as %20 contributes three.
In this formula, L is output length, K is the number of kept visible bytes or characters, E is the number of percent-escaped bytes, and P is the number of form spaces emitted as plus signs. For normal percent-encoded spaces, those spaces are counted inside E because each one is %20.
Rule Core
| Rule | Technical effect | When to check it |
|---|---|---|
Existing %XX triplets |
Preservation keeps valid triplets intact; otherwise the percent sign is encoded as %25. |
Use preservation for already-encoded data, not for literal percent signs. |
| Strict RFC 3986 escapes | Escapes !, ', (, ), and * after the selected URL encoding pass. |
Use it when another system expects conservative RFC 3986-style component output. |
| Unicode normalization | NFC and NFKC can change the code point sequence before UTF-8 bytes are produced. | Leave normalization off for signatures, exact identifiers, or byte-for-byte test cases. |
| Hex case | %2f and %2F represent the same byte, but fixed case improves comparison and review. |
Use uppercase for conventional handoff unless a downstream test fixture expects lowercase. |
| Parsed query preview | URL parsing decodes query keys and values for inspection. | Check it when a copied URL contains &, =, repeated keys, or a literal plus sign. |
Worked Examples:
Query value with reserved characters
Paste coffee beans & tea/latte?size=large and choose URL component. Encoded URL Text becomes coffee%20beans%20%26%20tea%2Flatte%3Fsize%3Dlarge. The ampersand, slash, question mark, and equals sign are escaped because they are data inside one value.
Path text that should keep separators
For docs/team notes/2026, choose Path with slashes. The output is docs/team%20notes/2026. Character Map should show the spaces encoded while the slash characters remain visible.
A whole URL with a risky query value
For https://example.com/search?q=coffee beans & tea, Full URL keeps URL delimiters and encodes spaces. That is useful when the ampersand is meant to separate query parameters. If coffee beans & tea is one search value, encode the value as a URL component before placing it after q=.
Fixing double-encoded escapes
If docs%2Fteam notes produces docs%252Fteam%20notes, the original slash escape was encoded again. Turn on Preserve existing %XX escapes when %2F is already intentional. Leave it off when the percent sign is literal text that must travel as data.
FAQ:
Should spaces be %20 or +?
Use %20 for normal URL components and paths. Use + only when Form/query value matches the parser that will read the value.
Why did a slash become %2F?
In URL component mode, a slash is treated as data and escaped. Choose Path with slashes when slash characters should stay as path separators.
Can I encode an entire URL?
Yes. Choose Full URL for a complete address so delimiters such as ://, /, ?, and & can stay structural. Use component mode for a value that will be inserted inside another URL.
Why did %2F become %252F?
The percent sign was encoded as data. Turn on Preserve existing %XX escapes if the existing escape is already correct; leave it off for a literal percent sign.
Why is the QR output not available?
QR Handoff requires encoded text and is limited to outputs short enough for practical QR generation. Use Copy Output when the QR surface is unavailable.
Does encoding make a suspicious link safe?
No. Percent-encoding changes how characters are represented inside a URL. It does not verify the destination, remove analytics parameters, or prove that opening the link is safe.
Glossary:
- Percent-encoding
- The URI escape format that writes a byte as
%plus two hexadecimal digits. - Reserved character
- A character that can act as URL syntax, such as
/,?,#,&, or=. - Unreserved character
- A character that can normally remain visible in a URI: letters, digits, hyphen, period, underscore, and tilde.
- UTF-8
- The byte encoding used before non-ASCII text is emitted as percent escapes.
- Unicode normalization
- A text process that can convert equivalent or compatibility characters into a consistent form before encoding.
- Form-style query value
- A query value convention where a space may be represented as
+instead of%20.
References:
- RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, IETF, January 2005.
- URL Standard, WHATWG.
- Unicode Standard Annex #15: Unicode Normalization Forms, Unicode Consortium.
- Percent-encoding glossary, MDN Web Docs.