[{"data":1,"prerenderedAt":221},["ShallowReactive",2],{"tool-content-base64":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":7,"slug":9,"faqs":10,"body":32,"_type":214,"_id":215,"_source":216,"_file":217,"_stem":218,"_extension":219,"sitemap":220},"\u002Ftools\u002Fbase64","tools",false,"","Base64","base64",[11,14,17,20,23,26,29],{"q":12,"a":13},"What is Base64 encoding?","Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, \u002F). It was designed to safely transmit binary data through systems that only handle text, like email (SMTP) or URLs. The name comes from the 64-character alphabet it uses.",{"q":15,"a":16},"Is Base64 a form of encryption?","No — Base64 is encoding, not encryption. It doesn't use any secret key and provides zero security. Anyone can decode Base64 instantly. It exists purely to convert binary data into a text-safe format, not to hide it. Never use Base64 alone to protect sensitive information.",{"q":18,"a":19},"Why does Base64 output end with = signs?","Base64 encodes every 3 bytes of input into 4 characters. If the input length isn't a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. One = means one byte of padding was added, two == means two bytes were added.",{"q":21,"a":22},"What is Base64url encoding?","Base64url is a variant of Base64 that replaces + with - and \u002F with _, making the output safe for use in URLs and filenames. JWT tokens use Base64url encoding. Standard Base64 and Base64url produce different output and cannot be used interchangeably without conversion.",{"q":24,"a":25},"When should I use Base64 encoding?","Use Base64 when you need to embed binary data (like images or files) in a text format such as HTML, CSS, JSON, or XML. Common examples include embedding small images as data URIs in CSS, sending binary file attachments in JSON API responses, and encoding binary data in JWTs or cookies.",{"q":27,"a":28},"Does Base64 encoding increase file size?","Yes — Base64 encoding increases the size of data by approximately 33%. Three bytes of input become four bytes of output. This is a trade-off worth making when you need to embed binary data in text, but it means Base64-encoded images in HTML\u002FCSS will be larger than serving them as separate files.",{"q":30,"a":31},"How do I decode a Base64 string in different programming languages?","In JavaScript use atob(encodedString). In Python use base64.b64decode(encoded_string). In PHP use base64_decode($encoded_string). In Java use Base64.getDecoder().decode(encodedString). In Go use base64.StdEncoding.DecodeString(encodedString). Our tool lets you do this instantly without writing any code.",{"type":33,"children":34,"toc":207},"root",[35,44,50,55,61,66,88,94,105,115,125,131,149,159,169,187,197],{"type":36,"tag":37,"props":38,"children":40},"element","h2",{"id":39},"what-is-base64",[41],{"type":42,"value":43},"text","What is Base64?",{"type":36,"tag":45,"props":46,"children":47},"p",{},[48],{"type":42,"value":49},"Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. The name refers to the 64-character alphabet used: A-Z (26 characters), a-z (26 characters), 0-9 (10 characters), and two additional symbols (+ and \u002F, or - and _ in the URL-safe variant).",{"type":36,"tag":45,"props":51,"children":52},{},[53],{"type":42,"value":54},"Base64 was originally developed for MIME (email) to allow binary attachments to be transmitted over text-only protocols. Today it's used across virtually every layer of web development.",{"type":36,"tag":37,"props":56,"children":58},{"id":57},"how-base64-encoding-works",[59],{"type":42,"value":60},"How Base64 encoding works",{"type":36,"tag":45,"props":62,"children":63},{},[64],{"type":42,"value":65},"Base64 takes every 3 bytes (24 bits) of input and converts them into 4 Base64 characters (each representing 6 bits). This is why the output is always about 33% larger than the input.",{"type":36,"tag":45,"props":67,"children":68},{},[69,71,78,80,86],{"type":42,"value":70},"For example, the text \"Otto\" encodes to ",{"type":36,"tag":72,"props":73,"children":75},"code",{"className":74},[],[76],{"type":42,"value":77},"T3R0bw==",{"type":42,"value":79},". The two ",{"type":36,"tag":72,"props":81,"children":83},{"className":82},[],[84],{"type":42,"value":85},"=",{"type":42,"value":87}," signs are padding because \"Otto\" is 4 bytes, not a multiple of 3.",{"type":36,"tag":37,"props":89,"children":91},{"id":90},"how-to-use-the-base64-tool",[92],{"type":42,"value":93},"How to use the Base64 tool",{"type":36,"tag":45,"props":95,"children":96},{},[97,103],{"type":36,"tag":98,"props":99,"children":100},"strong",{},[101],{"type":42,"value":102},"To encode:",{"type":42,"value":104}," select \"Encode →\" mode, paste your plain text into the left input, and the Base64 output appears immediately on the right.",{"type":36,"tag":45,"props":106,"children":107},{},[108,113],{"type":36,"tag":98,"props":109,"children":110},{},[111],{"type":42,"value":112},"To decode:",{"type":42,"value":114}," select \"← Decode\" mode, paste your Base64 string into the left input, and the decoded text appears on the right. If the Base64 string is invalid, you'll see an error message.",{"type":36,"tag":45,"props":116,"children":117},{},[118,123],{"type":36,"tag":98,"props":119,"children":120},{},[121],{"type":42,"value":122},"Swap:",{"type":42,"value":124}," use the Swap button to quickly reverse the operation — the output becomes the new input and the mode switches automatically.",{"type":36,"tag":37,"props":126,"children":128},{"id":127},"common-base64-use-cases",[129],{"type":42,"value":130},"Common Base64 use cases",{"type":36,"tag":45,"props":132,"children":133},{},[134,139,141,147],{"type":36,"tag":98,"props":135,"children":136},{},[137],{"type":42,"value":138},"Data URIs",{"type":42,"value":140}," — embedding small images directly in HTML or CSS without a separate HTTP request. A small icon might look like ",{"type":36,"tag":72,"props":142,"children":144},{"className":143},[],[145],{"type":42,"value":146},"\u003Cimg src=\"data:image\u002Fpng;base64,iVBOR...\">",{"type":42,"value":148},". This saves an HTTP round-trip for small assets.",{"type":36,"tag":45,"props":150,"children":151},{},[152,157],{"type":36,"tag":98,"props":153,"children":154},{},[155],{"type":42,"value":156},"JSON API responses",{"type":42,"value":158}," — when an API needs to return binary data (like a generated PDF or image) in a JSON response, Base64 encoding is the standard approach since JSON only handles text.",{"type":36,"tag":45,"props":160,"children":161},{},[162,167],{"type":36,"tag":98,"props":163,"children":164},{},[165],{"type":42,"value":166},"JWT tokens",{"type":42,"value":168}," — the three parts of a JWT (header, payload, signature) are all Base64url-encoded. Our JWT decoder handles the decoding, but understanding Base64 helps you understand how JWTs work.",{"type":36,"tag":45,"props":170,"children":171},{},[172,177,179,185],{"type":36,"tag":98,"props":173,"children":174},{},[175],{"type":42,"value":176},"Basic authentication",{"type":42,"value":178}," — HTTP Basic Auth sends credentials as ",{"type":36,"tag":72,"props":180,"children":182},{"className":181},[],[183],{"type":42,"value":184},"username:password",{"type":42,"value":186}," encoded in Base64 in the Authorization header. Note that this provides no security on its own — always use HTTPS.",{"type":36,"tag":45,"props":188,"children":189},{},[190,195],{"type":36,"tag":98,"props":191,"children":192},{},[193],{"type":42,"value":194},"Email attachments",{"type":42,"value":196}," — the original use case. MIME email standards use Base64 to encode binary attachments so they can be transmitted over text-only email protocols.",{"type":36,"tag":45,"props":198,"children":199},{},[200,205],{"type":36,"tag":98,"props":201,"children":202},{},[203],{"type":42,"value":204},"Storing binary data in databases",{"type":42,"value":206}," — when you need to store a binary value (like a hash or binary ID) in a text field in a database, Base64 encoding is a common approach.",{"title":7,"searchDepth":208,"depth":208,"links":209},2,[210,211,212,213],{"id":39,"depth":208,"text":43},{"id":57,"depth":208,"text":60},{"id":90,"depth":208,"text":93},{"id":127,"depth":208,"text":130},"markdown","content:tools:base64.md","content","tools\u002Fbase64.md","tools\u002Fbase64","md",{"loc":4},1777882945307]