url decodingpercent encodingencodingdebugging

How to Decode a URL and Read Encoded Links

If you have ever seen a URL filled with percent signs and wondered what it actually said, URL decoding is the answer. Here is how to read encoded URLs and turn them back into normal text.

6 min read

Related Tool

URL Decode

Open tool

Every developer eventually has to deal with a URL that looks like a mess of percent signs and hex codes. It might be a callback URL from an OAuth flow, a query string captured in your server logs, or a tracking link pasted by a colleague. URL decoding is how you turn that mess into readable text so you can understand what it is actually saying.

This article explains what URL decoding is, when you need it, and how to use the DevHexLab URL Decoder to handle even tricky cases like double encoded strings.

What Is URL Decoding?

URL decoding is the reverse of URL encoding. It takes percent encoded sequences like %20, %3F, and %C3%A9 and converts them back into the original characters they represent.

The rule is simple. Every percent sign in a URL is followed by exactly two hex digits. Those three characters together represent one byte of data. The decoder reads each one, looks up what character that byte represents, and replaces the sequence with that character.

For example, %20 decodes to a space, %3F decodes to a question mark, %2F decodes to a slash, and %C3%A9 (two bytes) decodes to the letter é.

Anything that is not a percent sequence is left alone. So decoding a URL gives you a readable string with all the original spaces, symbols, and accented letters restored.

When You Need to Decode

You need URL decoding in several common situations.

Reading log files

Server logs often store URLs exactly as they came in. That means values like search terms are still percent encoded. Decoding turns them into the original text so you can see what users were actually searching for or which paths they were visiting.

Debugging API integrations

When an API call is not behaving the way you expect, looking at the raw request URL is one of the first steps. If your query parameters look garbled, decode them to see the actual values being sent.

Inspecting OAuth and SSO redirects

OAuth callback URLs and SSO flows pack a lot of information into the query string, including state tokens, scopes, and return URLs. These values are often deeply nested and need decoding before they make sense.

Reading tracking links

Marketing platforms often pass campaign data through encoded query parameters. Decoding the URL reveals which campaign sent the visitor and what content they clicked.

How to Use the DevHexLab URL Decoder

Open the URL Decoder on DevHexLab. Paste the encoded URL or string into the input. The tool decodes everything automatically as you type. The readable output appears in the result area below. Click Copy to grab the decoded text.

Because everything happens in your browser, you can safely decode sensitive URLs from logs or internal systems without sending anything to an external server.

Watching Out for Double Encoded URLs

Sometimes a URL has been encoded more than once. This happens by accident in code that runs encoding twice, or on purpose in systems that need to wrap a URL inside another URL.

A double encoded space looks like %2520 rather than %20. That is because the percent sign in %20 got encoded a second time, becoming %25, leaving %2520.

If you decode a string once and still see percent sequences in the output, decode it again. You can keep decoding until you stop seeing percent codes. The DevHexLab decoder makes this easy because you can copy the output back into the input and decode another pass with a click.

Decoding vs Encoding: A Quick Comparison

To recap how the two relate, encoding turns unsafe characters into %XX sequences so a URL can carry them safely. Decoding turns %XX sequences back into the original characters so a human or program can read them.

If you encode a string and then decode the result, you get exactly the original string back. The process is fully reversible.

Tips for Working with Encoded Data

Always decode before parsing

If you receive a query string from an API or webhook, decode the values before you store or compare them. Otherwise "John Smith" might be saved as "John%20Smith" in your database, which is not what anyone wants.

Decode each value separately

When you have a URL with multiple query parameters, decode each value on its own, not the whole URL at once. This avoids problems where one value contains an ampersand or equals sign that should have stayed encoded.

Check for Base64 hiding inside

Sometimes a query parameter is Base64 encoded data that has been wrapped in URL encoding. First decode the URL part, then if the result still looks like a long string of letters, digits, and slashes, try a Base64 decode on it next.

Frequently Asked Questions

Why are some characters in a URL not encoded?

Letters A to Z, digits 0 to 9, and a small set of punctuation (like the hyphen, underscore, period, and tilde) are considered safe in URLs. They do not need encoding and most encoders leave them alone.

Can URL decoding fail?

Yes. If a percent sign is followed by something that is not two valid hex digits, the decoder cannot interpret it. Most decoders will either skip the invalid sequence or return an error. The DevHexLab decoder shows you exactly what could not be decoded so you can fix the source.

Is URL decoding safe to do on unknown input?

Decoding itself is safe. It does not execute anything, it just reads bytes and converts them. The risk comes from what you do with the decoded data afterward. Always validate decoded values before you trust them in a database query or in HTML output.

Can the same percent sequence mean different characters?

In modern systems, no. URL encoding uses UTF-8 by default and the mapping is one to one. In older systems that used Windows-1252 or other legacy encodings, the same percent sequence could mean different characters depending on the assumed encoding.

Start Decoding

URL decoding is a small skill that pays off every time you have to debug a redirect, read a log line, or understand a third party integration. Open the DevHexLab URL Decoder, paste any encoded string you have ever seen, and turn it back into something you can actually read.