Base64 Encoder

Base64 Encoder

Characters: 0Bytes: 0
Characters: 0Bytes: 0

Comments & questions

What is Base64 Encoding?

Base64 is an encoding scheme that converts binary data into 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It was developed to safely transmit binary data in text-only environments such as email attachments, web API communication, image-to-Base64 conversion (Data URIs), and JWT token payloads. It is defined by the RFC 4648 standard.

This free online Base64 converter encodes or decodes text, images, and files in real-time. It supports URL-Safe Base64, file upload, image preview, drag-and-drop, and conversion history (up to 10 entries). Full UTF-8 and Unicode support with all processing happening locally in your browser — your data never leaves your device.

Key Features

Real-time Encoding/Decoding

Enter text to instantly convert to Base64, or paste a Base64 string to restore the original text. Fully supports UTF-8 encoding.

URL-Safe Mode

URL-Safe mode replaces + with - and / with _, then removes trailing = padding. Check the alphabet and padding rules required by the receiving application.

File Upload & Image Preview

Upload files to automatically convert to Base64. Image files get a Data URI format preview.

Drag & Drop

Drag files into the input area for instant Base64 conversion. Fast and intuitive file processing.

How to Use

  1. Select Mode — Choose encode (text to Base64) or decode (Base64 to text) mode at the top.
  2. Enter Text or Upload File — Type or paste text to convert, or add files via the upload button or drag and drop.
  3. Set Options — URL-Safe replaces + with - and / with _, and removes trailing = padding. The line-break option inserts a break every 76 characters only when URL-Safe is off.
  4. Convert — Automatic conversion is on by default and updates the result about 0.3 seconds after input. The encode or decode button appears only when automatic conversion is off.
  5. Copy Result — Click the copy button to copy the conversion result to your clipboard.

Use Cases

API Development (Basic Auth)

In HTTP Basic Authentication, username:password is Base64 encoded and sent via the Authorization header. An essential encoding method for API testing.

Email Attachments

The MIME protocol uses Base64 to convert binary attachments into text format. It is the standard encoding method for email systems.

Data URI Image Embedding

Convert images to Base64 and embed them directly in HTML/CSS to display images without additional HTTP requests. Effective for small icons and logos.

Data Transfer & Storage

Use Base64 encoding when you need to include binary data in text-based formats like JSON or XML. Used in JWT tokens, configuration files, and more.

Base64 examples you can reproduce

Paste these exact inputs to check the results. Unless noted otherwise, use Encode with URL-Safe and line breaks off. Unicode text is converted through UTF-8 bytes, not its visible character count.

ASCII text and padding

Input
Hello
Result
SGVsbG8=

Five input bytes produce eight characters including padding. The trailing = was not part of the original text.

Korean text in UTF-8

Input
한글
Result
7ZWc6riA

These two characters occupy six UTF-8 bytes. No trailing padding is needed for this example.

An emoji in UTF-8

Input
🙂
Result
8J+Zgg==

This emoji occupies four UTF-8 bytes. The standard Base64 result includes + and =.

The same emoji with URL-Safe on

Input
🙂
Result
8J-Zgg

+ becomes - and trailing == is removed. In Decode mode, this result can be converted back to 🙂.

When a slash changes

Input
???
Result
Pz8_

This is the result with URL-Safe on. Turn it off to get Pz8/. Both represent the same input.

Scope and limitations

  • Base64 is not encryption. Do not use it to protect passwords or secret keys.
  • File encoding is supported, but decoding and download are for UTF-8 text. This is not a binary-file recovery tool.
  • File inputs larger than 15 MiB (15 × 1,024 × 1,024 bytes) are rejected. Smaller files can still be slow on memory-constrained devices.
  • Standard Base64 without line breaks has 4 × ceil(n / 3) characters for n input bytes. Padding can make the percentage increase greater than 33% for short inputs.

FAQ

Is Base64 encoding encryption?

No, Base64 is encoding, not encryption. Anyone can easily decode it, so it's not suitable for protecting sensitive data. It should only be used for data format conversion purposes.

What is URL-Safe Base64?

Base64url replaces + with - and / with _. This tool's URL-Safe option also removes trailing = padding. Check the receiving API or format to see whether padding may be omitted.

Why does Base64 encoding increase size?

Base64 converts 6 bits into 8-bit ASCII characters, so the encoded data size increases by approximately 33%. (3 bytes → 4 characters)

Does decoding an image's Base64 download the original file?

This tool decodes bytes as UTF-8 text and downloads a .txt file. It does not reconstruct binary files such as images or PDFs. If your input is a full Data URI, remove the data:…;base64, prefix before decoding its payload as text.

Are my input and conversion history stored?

Conversion runs in your browser, but history is saved in localStorage. The last 10 records contain up to 2,000 characters each of input and output, the mode, and a timestamp. Records may be saved after pausing in automatic text mode or when converting, copying, or downloading. Open Conversion History and choose Clear All. Clearing the input alone does not delete history.

Why can valid Base64 produce unreadable text?

Base64 represents bytes without specifying their character encoding. This tool reads decoded bytes as UTF-8. Another encoding or binary data such as an image may produce replacement characters (�). Check the UTF-8 validity badge; having output does not prove that the original data was correctly restored.

Privacy Notice

Conversion runs in your browser; the converter code does not upload your input text or files to a conversion server. However, the last 10 conversion records are saved in this browser's localStorage, including up to 2,000 characters each of input and output, the mode, and a timestamp. Copying or downloading a file conversion can also save part of its result. Delete records using Conversion History → Clear All. Avoid sensitive input on shared devices: closing the tab or clearing only the input does not necessarily remove history. See the site's privacy policy for separate advertising and usage-analytics information.

Standards and implementation references

Related Tools

Image to Base64URL EncoderHTML Entity ConverterJWT DecoderWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerGeoJSON Map EditorPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorJSON FormatterSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorJSON ↔ CSVCase Converter
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →