Trexmi

URL Encoder

Percent-encode UTF-8 text for use as one URL component while preserving JavaScript encodeURIComponent-safe characters.

UTF-8 percent encoding Space encoded as Reserved separator protection encodeURIComponent-style safe set
INPUT URL component to encode *
0 chars0 words0 lines
Paste the source value for this specific transformation. Example: docs/API v2?draft=true
Ctrl / ⌘ + Enter
Encoded URL component Encoded URL component ready to review and copy.
About the tool

What URL Encoder does

URL Encoder converts UTF-8 text into percent-encoded form suitable for one URL component. Spaces become %20, a slash becomes %2F, a question mark becomes %3F, and non-ASCII text is encoded from its UTF-8 bytes.

The output follows behavior comparable to JavaScript encodeURIComponent(): letters, digits, hyphen, underscore, period, tilde, exclamation mark, apostrophe, parentheses, and asterisk remain readable while structural separators are encoded.

Encode the value that belongs inside a URL, not an already assembled URL, unless you intentionally want its scheme and separators encoded too. Applying component encoding twice will encode existing percent signs again.

URL Encoder converting a UTF-8 parameter value into percent-encoded text
Encode one URL component without allowing its content to alter surrounding separators.

How to use

  1. Select the component. Isolate the query value, path segment, fragment value, or other text that needs encoding.
  2. Paste the exact text. Preserve Unicode, spaces, punctuation, and case.
  3. Run the encoder. Review the percent sequences in the separate result.
  4. Insert once. Place the encoded value in the expected URL location without re-encoding it.
  5. Test the final URL. Confirm that the receiving application decodes the intended value and preserves the surrounding structure.
Built for the task

Why use URL Encoder?

Focused controls, predictable output, and a workflow designed around this exact transformation.

01

Component-safe output

Encode separators such as slash, question mark, ampersand, equals sign, and hash inside a value.

02

UTF-8 support

Represent Ukrainian, accented text, emoji, and other Unicode through encoded UTF-8 bytes.

03

Visible transformation

Compare the exact source and encoded result before inserting it into a URL.

04

Double-encoding guidance

The page explains how existing percent sequences can be changed by a second encoding pass.

Useful answers

Questions about URL Encoder

Practical details about input, output, privacy, limits, and the best way to use this tool.

01 What does URL Encoder encode?

It encodes the supplied text as one URI component, including spaces, Unicode bytes, and reserved separators.

02 Does it encode an entire URL safely?

It will encode the entire input, including :, /, ?, and &. Usually you should encode only individual component values.

03 How are spaces encoded?

Spaces become %20, not a plus sign.

04 Why is a slash encoded?

Inside one component, an unencoded slash would act as a path separator, so it becomes %2F.

05 Does it support Unicode?

Yes. Text is represented as UTF-8 bytes and each required byte is percent-encoded.

06 What is double encoding?

Encoding an already encoded value changes %20 into %2520 because the percent sign itself becomes encoded.

07 Is URL encoding encryption?

No. It is reversible transport encoding and provides no confidentiality.

08 Can encoded text still be unsafe?

Yes. The receiver must still validate decoded paths, redirects, commands, and identifiers according to application rules.

Learn URL Encoding

Read the complete URL Encoding Guide

Learn percent-encoding, UTF-8 URLs, query strings, path segments, spaces, plus signs, and double-encoding mistakes.

  • Percent-encoding rules
  • Query strings and paths
  • UTF-8 and double encoding
Read guide Practical explanations and examples

Encode URL components without destroying URL structure

A complete HTTP URL contains structural delimiters: :// separates the scheme, slashes divide path segments, ? starts a query, ampersands separate parameters, equals signs pair names and values, and # starts a fragment.

Component encoding protects literal delimiter characters inside one value. If an entire complete URL is encoded in one pass, those structural characters become data and the result is no longer a directly navigable URL. Build the URL from separately encoded values instead.

How UTF-8 percent encoding works

Percent encoding writes a byte as a percent sign followed by two hexadecimal digits. ASCII space is byte 20 hexadecimal, so it becomes %20. Unicode characters use multiple UTF-8 bytes and therefore produce several percent sequences.

Encoding and decoding must agree on the text encoding. Modern web systems normally use UTF-8, but legacy data can produce unreadable text when interpreted with the wrong character set.

Query values, spaces, and plus signs

This encoder uses component-style percent encoding and writes a space as %20. Traditional HTML form encoding often writes spaces as +. Those conventions overlap but are not identical.

If a literal plus sign is significant, component encoding protects it as %2B. Confirm which convention the receiving API or framework expects rather than replacing characters manually.

Double encoding and other common mistakes

The most frequent error is encoding a value twice. Because an existing percent sign becomes %25, %2F changes to %252F. Preserve the raw source and record which layer of the application owns encoding.

Other mistakes include concatenating unencoded user values, encoding a complete URL unintentionally, and decoding then re-encoding signed URLs whose exact bytes are part of a signature.

Validation after URL encoding

Encoding prevents data from acting as separators, but it does not make the decoded value trustworthy. Validate redirect destinations, file paths, identifiers, and query values after decoding at the appropriate application boundary. Encoding is not sanitization, authorization, or encryption.

Related Trexmi tools

Reverse the result with URL Decoder, inspect full parameter sets with Query String Parser, or break down a complete address using URL Parser.

Technical references

See RFC 3986 for URI syntax and the MDN documentation for encodeURIComponent() behavior.