Utvikling · verktøy

URL-koder og -dekoder

Lim inn en URL eller tekstbit, velg retning og kopier resultatet.

Kjøres i nettleseren. Ingen opplasting.

Use encode for text that must travel safely inside a URL.

Om verktøyet

URL-koder og -dekoder sem complicação.

Konverteringen skjer umiddelbart i nettleseren med den innebygde URL-standarden.

Veiledning

Slik bruker du URL-koder og -dekoder

This page turns plain text into percent-encoded text, and back again. Percent encoding replaces characters that are not safe inside a link, such as spaces, ampersands and accented letters, with a percent sign and two hex digits. Paste your text, choose Encode or Decode, and press Convert. It encodes the whole input as one piece of text, so it is meant for values like a search term. It does not check or fix full web addresses.

Slik gjør du

  1. Paste or type your text into the box. Use the whole text you want to convert.
  2. Choose Encode URL text to make it safe for a link, or Decode URL text to turn percent codes back into normal characters.
  3. Press Convert. The answer appears in the Result box and a green message says the conversion is complete.
  4. Press Copy result to copy it. Press Clear to empty both boxes and start again.

Eksempler

Encode a phrase with a space

Du skriver inn
Modus
encode
Tekst
hello world
Du får
Resultat
hello%20world

A space becomes %20. The tool does not use a plus sign for spaces.

Kjørt med verktøyets egen kode.

Encode a full address

Du skriver inn
Modus
encode
Tekst
https://example.com/search?q=cats & dogs
Du får
Resultat
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcats%20%26%20dogs

Colons, slashes, question marks, equals signs and ampersands are all encoded too. The result is no longer a clickable address, which is right when the whole thing is a value inside another link.

Kjørt med verktøyets egen kode.

Letters outside plain English

Du skriver inn
Modus
encode
Tekst
café 日本
Du får
Resultat
caf%C3%A9%20%E6%97%A5%E6%9C%AC

Each character is turned into UTF-8 bytes, and each byte is written as a percent code. The accent in é uses two bytes.

Kjørt med verktøyets egen kode.

Decode, and an error case

Du skriver inn
Modus
decode
Tekst
caf%C3%A9
Du får
Resultat
café
Ugyldig inndata
100% gives the error: This text has an invalid URL escape sequence.

Valid codes turn back into letters. A lone percent sign that is not followed by two hex digits cannot be decoded, so the tool clears the result and shows an error.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Prepare a search phrase or a name before you add it to a link as a query value.
  • Read a long link full of %20 and %2F codes by decoding it.
  • Check what a tracking or redirect parameter really contains.
  • Build a mailto or share link whose subject line has spaces and symbols.
  • Test how text with accents or non-Latin letters will look in a link.
  • Fix a link that broke because an ampersand or hash sign was inside a value.

Begrensninger

  • It encodes everything except letters, digits and the symbols - _ . ! ~ * ' ( ). That includes slashes, colons and question marks, so do not feed it a complete address and expect a working link back.
  • Decoding does not turn a plus sign into a space. Text such as a+b stays as a+b.
  • Decoding a text that has been encoded twice only removes one layer. %252F becomes %2F, and you must press Decode again to get a slash.
  • Invalid codes such as a lone percent sign or %zz stop the conversion and show an error instead of a partial result.
  • It converts one piece of text. It does not split an address into parts, validate it or open it.

Tips

  • Encode each value on its own, such as the search term, and then place it after the equals sign yourself.
  • If a result still shows %25 in it, the text was probably encoded twice. Decode once more.
  • A new line is encoded as %0A, so you can paste several lines, but check that the link you build can carry them.
  • Do not paste secrets such as passwords. Encoding hides nothing, because anyone can decode it.

Kilder

Vanlige spørsmål

Sobre URL-koder og -dekoder.

What does URL encoding do?

It replaces characters that could confuse a link, such as spaces, ampersands and non-English letters, with a percent sign and two hex digits. The result can travel inside a link without being cut or misread by a browser or server.

Why does a space turn into %20?

The space character has the byte value 20 in hexadecimal, and percent encoding writes that as %20. Some form data uses a plus sign for spaces instead, but this tool always writes %20.

Should I paste a whole URL or only part of it?

Paste only the part that is a value, like a search term or a name. If you paste a whole address, the slashes and colons are encoded too and the link will not open. Use a URL parser to read an address instead.

What is the difference between encodeURI and encodeURIComponent?

encodeURI leaves characters that structure a link, such as slashes and question marks, alone. encodeURIComponent encodes them. This tool follows the encodeURIComponent style, so it is meant for single values.

Why do I get an invalid URL escape sequence error?

The text has a percent sign that is not followed by two valid hex digits, or the codes form bytes that are not valid UTF-8. Fix or remove the broken part, for example change a bare 100% into 100%25, and try again.

How do I decode a plus sign as a space?

This tool does not do it. Replace each plus sign with a space yourself before you decode, but only if the text really came from form data. In normal paths and in most other places a plus sign means a plus sign.

Does it handle emoji and other languages?

Yes. Characters are converted to UTF-8 bytes first, so an emoji such as a smiling face becomes %F0%9F%98%80 and Japanese letters become groups of three codes each.

Is the text I paste uploaded anywhere?

No. The conversion happens in your browser with built-in functions, and nothing is sent to a server. Even so, avoid pasting passwords or private keys into any web page.

Is URL encoding a form of security or encryption?

No. It only changes how characters are written, and anyone can reverse it with one click. Never use it to hide private data.

Hvordan bruker du URL-koder?

Lim inn en URL eller tekstbit, velg retning og kopier resultatet.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.