Utvikling · verktøy

Base64-koder og -dekoder

Velg retning, lim inn verdien og konverter den lokalt.

Kjøres i nettleseren. Ingen opplasting.

Runs only in your browser.

Om verktøyet

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

Støtter vanlig Unicode-tekst og krever ingen innlogging eller API.

Veiledning

Slik bruker du Base64-koder og -dekoder

Base64 is a way of writing any text using only letters, digits, plus, slash and equals signs. This page turns ordinary text into that form and turns it back. Pick Encode or Decode, paste your value, and press Convert. Accented letters, symbols and the euro sign work, because the text is handled as UTF-8. It is handy for developers and anyone who meets odd-looking strings in emails or settings. Base64 is not encryption: anyone can reverse it in a second, so it must never be used to protect a secret.

Slik gjør du

  1. Choose Encode to Base64 if you have normal text, or Decode Base64 if you have a Base64 string. The hint in the box changes to match.
  2. Paste or type your value into the Value to convert box. When you decode, line breaks and spaces inside the string are ignored.
  3. Press Convert. The answer appears in the Result box and the status line says the conversion is complete.
  4. Use Copy result to put the answer on your clipboard, or Clear to empty both boxes and start again.

Eksempler

Encode a short greeting

Du skriver inn
Modus
Encode to Base64
Verdi
Hello, world!
Du får
Resultat
SGVsbG8sIHdvcmxkIQ==

Every 3 bytes of text become 4 characters. Thirteen letters do not fill the last group, so two equals signs are added as padding.

Kjørt med verktøyets egen kode.

Encode accents and a euro sign

Du skriver inn
Modus
Encode to Base64
Verdi
café ñ €
Du får
Resultat
Y2Fmw6kgw7Eg4oKs

The text is first turned into UTF-8 bytes. The letter é takes two bytes and the euro sign takes three, which is why the result is longer than you might expect.

Kjørt med verktøyets egen kode.

Decode a string with its padding left off

Du skriver inn
Modus
Decode Base64
Verdi
SGVsbG8sIHdvcmxkIQ
Du får
Resultat
Hello, world!

The browser decoder used here accepts a missing equals-sign ending, so this is read the same as the padded version. Spaces and line breaks in the middle are ignored too.

Kjørt med verktøyets egen kode.

Why this is not a lock

Du skriver inn
Modus
Encode, then Decode
Verdi
password123
Du får
Kodet verdi
cGFzc3dvcmQxMjM=
Dekodet på nytt
password123

There is no key and no secret step. Anyone with the encoded string and this page, or any other decoder, gets the original text back at once.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Reading a short Base64 value copied from a settings file or an email header.
  • Preparing a text value for a place that only accepts plain letters and digits.
  • Checking by hand what a developer or an API sample means by a long odd string.
  • Teaching students how bytes, UTF-8 and text encodings relate.
  • Confirming that a string you were given really is Base64 and not something else.

Begrensninger

  • This is text only. There is no file box, so it is not meant for turning pictures or documents into Base64.
  • Decoding accepts the standard letters, digits, plus, slash and equals only. A string that uses the web-safe dash and underscore, or has stray punctuation, is reported as not valid Base64.
  • A decoded result is read as UTF-8 text. If the underlying bytes were not text, such as part of an image, you will see broken replacement symbols instead of the original data.
  • The result is about one third longer than the input, because each 3 bytes become 4 characters.

Tips

  • Treat anything you encode here as readable by everyone who sees it, and keep passwords and keys out of it.
  • If decoding fails, look for a missing character, a dash or underscore, or a stray quote around the string.
  • Decode the result once again to be sure you get your original text back before you rely on it.

Kilder

Vanlige spørsmål

Sobre Base64-koder og -dekoder.

Is Base64 a form of encryption?

No. It is only a way to write data using a fixed set of characters. There is no key, so anyone can decode it. The standard that defines it says base encoding hides information from the eye but gives no computational confidentiality. Use real encryption for secrets.

Why does the encoded text end with equals signs?

Base64 works in groups of 3 bytes that become 4 characters. When the last group is short, one or two equals signs fill it up. Text whose byte count divides by 3 has no padding at all.

Does it work with accents, emoji and other languages?

Yes for ordinary Unicode text. The page converts your text to UTF-8 bytes before encoding, and reads the bytes as UTF-8 when decoding. Characters outside the usual alphabet simply take more bytes, so the encoded string gets longer.

Why do I get a message that my text is not valid Base64?

The decoder found a character it does not accept or a length that cannot be right. Common causes are a dash or underscore from the web-safe version, extra quote marks, a missing character, or text that was never Base64 to begin with.

Can I decode an image or a PDF here?

Not in a useful way. The result is shown as text, and the box has no file download. Bytes that are not valid UTF-8 text appear as replacement symbols. Use a tool made for files if you need the original picture or document.

Does it accept line breaks inside the string?

Yes when decoding. Spaces, tabs and line breaks are removed before the string is read, so a value wrapped over several lines still works. When encoding, line breaks you type are part of the text and are encoded too.

Is my text sent to a server?

No. The page states that it runs only in your browser, and the conversion uses built-in browser functions. Nothing you paste is uploaded. As always, be careful on shared computers and clear the boxes when you finish.

What is the difference between this and URL encoding?

URL encoding keeps text readable and only escapes characters that are unsafe inside a web address, using percent codes. Base64 rewrites the whole text as a different alphabet. They solve different problems, and the page has a separate tool for URL encoding.

When should I not trust the result?

Be careful with values from unknown sources. A decoded string may contain links or commands that you should not run. Also remember that a clean decode proves nothing about who wrote the data or whether it was changed on the way.

Hvordan bruker du Base64-konverterer?

Velg retning, lim inn verdien og konverter den lokalt.

Lastes dataene mine opp til en server?

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