Security & Encryption ابزار به‌روزرسانی شد 26 دقیقه پیش

Base64 Encoder and Decoder (All Browser Support)

Encode text to standard Base64 or decode a Base64 string in your browser. Data URI prefixes are stripped automatically, and character counts show how much the payload grew.

Base64 is not encryption. Files can be uploaded and encoded directly, and decoded images are recognised from their first bytes; still verify any decoded file before relying on it.

Base64 Encode Decode Text Encoder Decoder Browser Support

استفاده Base64 Encoder and Decoder (All Browser Support)

رمزگذار و رمزگشای Base64

متن/فایل‌ها را به Base64 رمزگذاری کنید یا Base64 را به متن رمزگشایی کنید.

ورودی: 0 حروف خروجی: 0 حروف بزرگ‌نمایی: 0%
ورودی: 0 حروف خروجی: 0 حروف نوع: text
لینک ابزار
به کلیپ‌بورد کپی شد.
به بهبود این ابزار کمک کنید

محتوا را بخوانید

بیاموزید که این ابزار چگونه کار می‌کند و چه زمانی باید از آن استفاده کنید.

Base64 Encoder and Decoder

What Base64 encoding is

Base64 turns bytes into a text string made from 64 printable characters. It is used when a system can carry text but not raw binary: email attachments, JSON fields, data URIs, tokens and configuration files. The output is longer than the input, usually by about a third. Base64 is not encryption and it is not compression. Anyone can decode it. It hides nothing and shrinks nothing; it simply makes binary data safe to move through text-only channels.

Encoding text in the browser

Open the Encode tab, type or paste text into the editor and wait for the automatic conversion. You can also press the encode button. The result appears in the output area, with character counts and a blow-up percentage. The conversion uses the browser's text encoder and btoa, so it handles ordinary Unicode text after encoding it to bytes. Copy the result into the destination field. Nothing is uploaded; the text stays in the page.

Decoding Base64 text

Open the Decode tab, paste a Base64 string and let the tool decode it. A data URI prefix such as data:image/png;base64, is stripped before decoding. If the string is valid, the plain text appears in the output. If it is not valid, the page shows an error instead of silently producing garbage. Use the clear button before starting a new value, especially if you are comparing several strings.

Data URIs and prefixes

A data URI combines a media type, an optional base64 marker and the encoded bytes in one string. For example, a small PNG can be written as data:image/png;base64, followed by the Base64 payload. This tool removes that prefix when decoding, so you can paste the whole URI or just the payload. It does not validate that the declared media type matches the bytes. A prefix is a label, not proof of the file's contents.

Character counts and size growth

The page shows input and output character counts and a blow-up percentage. Base64 normally produces about four characters for every three bytes, which is roughly a 33 percent increase before any line breaks or prefixes. A long document can therefore become a much larger string. If a field has a size limit, check the encoded length, not the original word count. The tool does not provide a line-wrapping option or a URL-safe alphabet.

File upload and binary data

Use the file upload control on the Encode tab to encode a file directly. The page reads the file bytes once and writes the Base64 straight into the output, while the input editor shows a short summary with the file name, type and size. This is the path to use for images, PDFs, ZIP files and other binary data. When you decode, the page checks the first bytes of the result for PNG, JPEG, GIF and WebP signatures, shows the detected type and byte count, and previews the image using that type.

Encoding versus encryption

Base64 is sometimes mistaken for protection because the output looks unreadable. It is trivially reversible. If you need confidentiality, use encryption and key management. If you need integrity, use a signature or a checksum. If you need to store a password, use a password-hashing function, not Base64. Never put a secret into a Base64 string and assume it is safe because it no longer looks like plain text.

When Base64 is useful

It is useful for embedding a small image in CSS or HTML, sending binary data through a JSON API, storing a small certificate or key fragment in a text field, and debugging an email attachment. It is a transport encoding. Use it at the boundary where a text-only channel requires it, then decode it back to bytes at the other end. Do not use it as a database storage strategy for large files when a file store is available.

URL-safe and line breaks

Standard Base64 uses plus and slash, which can be awkward in URLs. A URL-safe variant replaces them with hyphen and underscore. This tool does not expose a URL-safe mode, and it does not add or remove line breaks. If an API expects URL-safe Base64, use a converter that supports that alphabet. If it expects MIME line wrapping, check the specification; a single long line may be rejected.

Privacy and local processing

Encoding and decoding happen in your browser. The text is not sent to Newisty. That makes the page convenient for non-sensitive payloads, but local processing does not make a secret safe. The browser, extensions, clipboard and screen recording can still expose the value. Clear the editor when you are done, avoid pasting production credentials, and remember that copied text may remain in the clipboard history.

Common problems

If decoding fails, check for spaces, line breaks, a missing padding character or a prefix that was not removed. If the output looks like mojibake, the bytes may not be UTF-8 text. If the page is slow with a very large value, the browser is holding the whole string in memory; there is no streaming mode.

What not to do

Do not call Base64 encryption. Do not use it to hide passwords, API keys or personal data. Do not paste a production secret into a random online tool. Do not assume the decoded bytes are an image just because the string starts with a known prefix. Always verify the decoded output before using it.

Worked examples and padding

Base64 works on groups of three bytes, turning each group into four characters. When the input does not divide evenly into threes, the output is padded with one or two = signs. That is why short strings show a much larger Blowup figure than the usual third:

InputBytesBase64Blowup shown
Hello5SGVsbG8=+60.0%
Hi!3SGkh+33.3%
café5Y2Fmw6k=+100.0%

The last row shows why non-English text grows more: the Blowup compares characters, but an accented letter takes two bytes in UTF-8, and emoji take four. If a field limit is measured in characters, measure the encoded output, not the original text.

Loading Base64 from a file and the Type label

On the Decode tab, Upload .txt reads a .txt, .b64 or .base64 file as text, puts its contents in the input editor and decodes it straight away. The file is read by your browser and is not uploaded. Below the decoded output, the Type label reads "text" unless the decoded bytes start with the file signature of a PNG, JPEG, GIF or WebP image. In that case the label shows the image type, the output box shows a summary such as [image/png, 2,048 bytes] instead of unreadable characters, and the preview uses the detected type. Ordinary text, even text beginning with "GI" or "RI", stays labelled as text.

Frequently Asked Questions

پرسش‌های متداول

پاسخ‌های کوتاه به پرسش‌هایی که کاربران پیش از اعتماد به نتیجه مطرح می‌کنند.

No. Base64 is a reversible encoding, not encryption. Anyone can decode it without a key. Use encryption for confidentiality and password hashing for stored passwords. Base64 only makes binary data safe to carry through text channels.

No. Encoding and decoding run in your browser. The text is not sent to Newisty. That does not make secrets safe: extensions, clipboard history, screen capture and shared devices can still expose the value.

Base64 represents every three bytes with four printable characters, so the text grows by roughly a third before prefixes or line breaks. The page shows the exact character counts and a blow-up percentage so you can check a field limit.

Yes. Paste the whole data URI or just the Base64 payload. The decoder strips the data:...;base64, prefix before decoding. It does not verify that the declared media type matches the actual bytes.

Open the Encode tab and use the file upload control. The file bytes are encoded once and the Base64 appears in the output, while the editor shows the file name, type and size. To check the result, paste it into the Decode tab: images are recognised from their first bytes and previewed.

No. The page uses the standard alphabet, which includes plus and slash. A URL-safe variant uses hyphen and underscore and is not offered here. Use a converter that explicitly supports the alphabet your API expects.

The string may contain spaces, line breaks, missing padding or characters outside the Base64 alphabet. It may also include a prefix the decoder does not recognise. Clean the value and try again, and confirm that the source actually used standard Base64.

They are padding. Base64 encodes three bytes at a time, and when the input does not divide evenly by three, one or two = signs fill the last group.

Yes. Text is converted to UTF-8 bytes before encoding, so accented letters, other scripts and emojis encode and decode correctly.

Yes. On the Decode tab, Upload .txt accepts .txt, .b64 and .base64 files, reads them in your browser and decodes the contents.

نظرات (0)

برای بحث کاربران، موارد حاشیه‌ای و نکات پیگیری.
یک نظر بگذارید
نظر شما پس از ارسال به‌صورت عمومی نمایش داده خواهد شد.
هنوز نظری ثبت نشده است. اولین نفری باشید که نظر می‌دهد!
به ما اطلاع دهید!
گزارش مشکل این ابزار

مسئله‌ای را که با آن مواجه شدید شرح دهید تا بتوانیم آن را بررسی کرده و ابزار را بهبود بخشیم.

چه چیزی بیشتر کمک می‌کند
ورودی، نتیجهٔ مورد انتظار، نتیجهٔ واقعی، مرورگر/دستگاه و در صورت کمک‌کننده بودن، یک اسکرین‌شات را درج کنید.
دکمهٔ اسکرین‌شات صفحه را در مرورگر ثبت می‌کند و تصویر تولیدشده را به این فرم پیوست می‌کند.
اسکرین‌شات تمام‌صفحه
در مرورگر شما با newisty ضبط شده است.
هنوز هیچ اسکرین‌شاتی گرفته نشده است.
ابزار گزارش