Text & Code

Base64 Text Encoder / Decoder

Encode text to Base64 and decode Base64 back to text. URL-safe mode available.

Your files stay on your device - processed locally via WebAssembly, never uploaded

🔒 All encoding and decoding happens in your browser. Nothing is sent anywhere.

Share this tool with othersHelp others discover free tools
Embed this tool on your website

Copy this code to add the Base64 Text Encoder / Decoder to your site for free. It runs entirely in your visitors' browsers - no API key, no usage limits.

<iframe src="https://optipix.art/embed/base64-text" width="100%" height="600" style="border:1px solid #e4e4e7;border-radius:8px;" title="Base64 Text Encoder / Decoder by OptiPix" loading="lazy"></iframe>
<p style="font-size:12px">Free tool by <a href="https://optipix.art/base64-text">OptiPix Base64 Text Encoder / Decoder</a></p>

❤️ Love this tool? Support our team.

No ads, no tracking, no limits. Tips keep 104 tools free for everyone.

$

Secure payment via Stripe · No account needed

About Base64 Text Encoder / Decoder

Last updated: May 2026

OptiPix Base64 Text Encoder/Decoder converts between plain text and Base64 encoding directly in your browser. Encode any UTF-8 text to Base64, or decode Base64 strings back to readable text. Toggle URL-safe Base64 mode to use - and _ instead of + and / for URL and filename compatibility. Enable live mode for real-time conversion as you type. See input/output size stats showing the encoding overhead. Drop any file to encode its bytes to a Base64 string, or paste a Base64 string to decode and download as a file. This tool handles text and arbitrary files - for image-specific Base64 with preview and CSS output, see the Image to Base64 tool. All processing happens locally in your browser.

How It Works

The tool uses JavaScript's btoa() and atob() functions for ASCII-range text. For full UTF-8 support, it first encodes the text using TextEncoder, then converts the byte array to a Base64 string. URL-safe mode swaps + for - and / for _ in the output.

Use Cases

  • Encode API keys and tokens for configuration files
  • Decode Base64-encoded data from APIs and JWTs
  • Convert files to Base64 for embedding in JSON payloads
  • Prepare data for email MIME encoding
  • Debug Base64-encoded strings in web applications

You Might Also Like

If you find Base64 Text Encoder / Decoder useful, check out these related tools: URL Encoder / Decoder, Text to Binary / Hex / Octal, and Hash Generator. All tools run entirely in your browser with no uploads or signups required.

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It increases the size by about 33% but makes binary data safe for text-based systems like email, JSON, and URLs.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ to avoid conflicts with URL reserved characters. This variant is used in JWTs, data URIs, and URL parameters.
Can I encode files, not just text?
Yes. Drop any file into the tool and it will encode the raw bytes to Base64. You can also paste a Base64 string and download the decoded bytes as a file.
How is this different from the Image to Base64 tool?
This tool handles any text or file generically. The Image to Base64 tool is specialized for images and provides preview, data URI, HTML, and CSS output.
Is my data sent to any server?
No. All encoding and decoding uses the browser's built-in btoa/atob functions and runs entirely on your device.

Related Tools

More Text & Code Tools

All 102 Tools

Image CompressorBackground RemoverVideo CompressorImage UpscalerOCR Text ExtractorFormat ConverterImage ResizerEXIF RemoverFace BlurDepth EstimationQR Code GeneratorWatermark MakerColor Palette ExtractorPhoto FiltersImage to PDFObject DetectionImage ClassifierImage CaptionerAI Image GeneratorMeme GeneratorGIF MakerPhoto Collage MakerImage CropPhoto EffectsImage to SVGColor ChangerNoise RemoverPhoto RestorationColor PickerFavicon GeneratorImage to Base64Image Metadata ViewerImage AnnotatorPassport Photo MakerDocument ScannerASCII Art GeneratorImage ComparisonSprite Sheet GeneratorObject RemoverPanorama MakerWord CounterCase ConverterLorem Ipsum GeneratorUUID GeneratorUnix Timestamp ConverterText DiffURL Encoder / DecoderHTML Entity Encoder / DecoderBase64 Text Encoder / DecoderText to Binary / Hex / OctalHash GeneratorJSON Formatter / ValidatorRandom String GeneratorCSV ↔ JSON ConverterMarkdown EditorUnit ConverterPercentage CalculatorBMI CalculatorAge CalculatorTip CalculatorCSS Gradient GeneratorCSS Box Shadow GeneratorCSS Border Radius GeneratorGlassmorphism GeneratorNeumorphism GeneratorCSS Text Shadow GeneratorFlexbox PlaygroundCSS Grid GeneratorAudio TrimmerAudio ConverterAudio MergerAudio RecorderVideo to Audio ExtractorAudio Speed ChangerAudio Volume BoosterRingtone MakerVocal RemoverText to SpeechSpeech to TextAudio Noise RemoverAudio EqualizerAudio EffectsVideo TrimmerVideo MergerVideo ResizerVideo Speed ChangerVideo RotatorVideo to MP4 ConverterAdd Music to VideoMute VideoVideo LooperReverse VideoVideo ScreenshotAdd Subtitles to VideoVideo WatermarkScreen RecorderWebcam RecorderSlideshow MakerVideo FiltersCron Expression BuilderRegex TesterUnix Timestamp Converter