Uniform Resource Locator (URL) Encoder
Encode URL components, complete links, form values, or paths with context-aware percent escapes, UTF-8 byte details, and local query checks.{{ outputText }}
QR handoff is limited to encoded output of 2,000 characters or fewer. Copy or download the text instead.
{{ qrError }}
| # | Input | Class | UTF-8 bytes | Encoded | Copy |
|---|---|---|---|---|---|
| {{ row.position }} | {{ row.input }} | {{ row.class_label }} | {{ row.bytes }} | {{ row.encoded }} |
Showing the first {{ characterRows.length.toLocaleString() }} audit rows; totals and the encoded result cover the complete source.
| # | Key | Decoded value | State | Copy |
|---|---|---|---|---|
| {{ row.position }} | {{ row.key }} | {{ row.value }} | {{ row.state }} |
A working link can break when data is mistaken for URL syntax. If a search phrase contains an ampersand, a parser may read it as the start of another query parameter. A question mark inside a filename can look like the beginning of a query. Percent-encoding prevents that collision by representing data bytes as triplets such as %26 for an ampersand.
Encoding is not applied to every URL in the same way. A complete link already contains meaningful separators, while one query value should normally treat those separators as data. Path handling often keeps slash boundaries. HTML forms use a related serialization in which a space becomes + instead of %20.
- Percent triplet
- A percent sign followed by two hexadecimal digits that represents one byte.
- Unreserved character
- A letter, digit, hyphen, period, underscore, or tilde that normally remains literal.
- Reserved delimiter
- Punctuation such as
:,/,?,#,&, or=whose meaning depends on its position.
International text is encoded as bytes, not as a single replacement for each visible character. The letter é uses the UTF-8 bytes C3 A9, so its percent-encoded form is %C3%A9. Hexadecimal letter case does not change the represented bytes, although consistent uppercase or lowercase escapes can make comparisons easier.
Percent-encoding preserves representation, not trust. It does not prove that a hostname is safe, that a query value is valid for an application, or that a complete URL points where its text appears to point. Build the value for its exact destination context and inspect the finished URL before using it.
How to Use This Tool:
Decide where the source will be inserted before encoding it. That choice determines which punctuation remains structural.
- Choose Encoding target: a URL component or query value, a full URL, a form value, or a path whose slashes must remain separators.
- Paste up to 12,000 Unicode characters into Text or URL. Leave Trim outer whitespace off when leading or trailing characters are meaningful.
- Use Preserve existing %XX escapes only when complete triplets in the source are already intentional. Leave it off when a percent sign is literal or when the input may already be incorrectly encoded.
Preservation accepts any complete hexadecimal triplet as an existing escape. Check that the triplet represents the byte you intended.
- Compare Encoded text with the character audit. For a complete HTTP or HTTPS link, also read Query preview to confirm that keys and decoded values still separate as expected.
Interpreting Results:
A result labeled as an HTTP or HTTPS URL passed the browser's absolute-URL parsing check. That is a syntax result, not a reachability or safety check. Verify the destination host and the decoded meaning of every query value before opening or sharing it.
The character audit distinguishes text kept as-is, UTF-8 bytes turned into percent escapes, form spaces turned into plus signs, and existing escapes deliberately preserved. It displays at most 240 token rows, so the encoded text remains the complete output when a longer input truncates the audit.
Technical Details:
RFC 3986 defines percent-encoding as %HH for one octet and separates reserved characters from the unreserved set. The same character may remain literal in one URL part and require encoding in another because delimiters are interpreted according to context.
Transformation Core:
| Target | Core operation | Deliberate exception |
|---|---|---|
| Component or query value | Encode the complete well-formed Unicode value with component rules. | No URL separators are restored. |
| Full URL | Encode characters that cannot remain literal while retaining structural URL delimiters. | The input is not rebuilt or normalized as a canonical URL. |
| Form value | Apply component encoding, then replace encoded spaces %20 with +. |
A literal plus in the source becomes %2B. |
| Path | Apply component encoding, then restore encoded slash bytes to /. |
Slash remains a segment separator rather than data inside one segment. |
Before byte encoding, unmatched UTF-16 surrogate code units are replaced with the Unicode replacement character so the source is well formed. Optional NFC or NFKC normalization runs before encoding. NFC composes canonically equivalent sequences; NFKC can also replace compatibility characters, so normalization can change the exact source representation.
Strict RFC 3986 mode additionally encodes !, ', (, ), and *. Percent escape case can then be kept, uppercased, or lowercased without changing the represented bytes. When preservation is enabled, complete existing %XX triplets bypass normal encoding and only their hexadecimal case may change.
Byte path:
café & tea in component mode becomes caf%C3%A9%20%26%20tea. The unreserved letters remain literal, é contributes the two UTF-8 bytes C3 and A9, spaces become %20, and the ampersand becomes %26 so it cannot be mistaken for a query-pair separator.
Worked Example:
Search value inside a query
The value coffee & tea/latte? belongs after a query key, so component mode produces coffee%20%26%20tea%2Flatte%3F. Appending that result after ?q= keeps the ampersand, slash, and question mark inside the search value instead of letting them change the surrounding URL structure.
References:
- RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, RFC Editor, January 2005.
- URL Standard, WHATWG.
- Unicode Standard Annex #15: Unicode Normalization Forms, Unicode Consortium.