{"id":8813,"date":"2026-08-05T15:36:38","date_gmt":"2026-08-05T13:36:38","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/?p=8813"},"modified":"2026-08-05T18:31:56","modified_gmt":"2026-08-05T16:31:56","slug":"base64-encode-decode-tool","status":"publish","type":"page","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/","title":{"rendered":"Base64 Encode &#038; Decode Tool"},"content":{"rendered":"<div class=\"base64-tool-container\" style=\"background: var(--bg-panel, #1e1e24); padding: 25px; border-radius: 8px; border: 1px solid var(--border, #2a2a35);\">\n<p style=\"color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6;\">\n        Encode any text or JSON payload into a UTF-8 safe Base64 string, or decode Base64 data back into readable text.<br \/>\n        All encoding and decoding happens locally in your browser \u2014 zero data is sent to or stored on any server.\n    <\/p>\n<p>    <!-- INPUT AREA --><\/p>\n<div style=\"margin-bottom: 20px;\">\n<div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;\">\n            <label style=\"color: var(--text-primary); font-weight: 700; font-size: 0.9rem;\">Input Data:<\/label><br \/>\n            <button id=\"clear-input-btn\" style=\"background: transparent; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.8rem; text-decoration: underline;\">Clear Input<\/button>\n        <\/div>\n<p>        <textarea id=\"base64-input\" placeholder=\"Paste your raw text, JSON, or Base64 encoded string here...\" style=\"width: 100%; height: 180px; padding: 15px; background: var(--bg-body, #101416); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: monospace; font-size: 0.9rem; box-sizing: border-box; resize: vertical;\"><\/textarea>\n    <\/div>\n<p>    <!-- ACTION BUTTONS --><\/p>\n<div style=\"display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;\">\n        <button id=\"encode-btn\" class=\"button\" style=\"background: var(--accent, #2ba6df); color: #0b1114; border: none; padding: 11px 24px; border-radius: 6px; font-weight: 700; cursor: pointer;\">Encode to Base64<\/button><br \/>\n        <button id=\"decode-btn\" class=\"button\" style=\"background: transparent; border: 1px solid var(--accent, #2ba6df); color: var(--accent, #2ba6df); padding: 11px 24px; border-radius: 6px; font-weight: 700; cursor: pointer;\">Decode from Base64<\/button><br \/>\n        <button id=\"swap-btn\" class=\"button\" style=\"background: #242b30; color: var(--text-primary); border: 1px solid var(--border); padding: 11px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; margin-left: auto;\">\u2191\u2193 Swap Input \/ Output<\/button>\n    <\/div>\n<p>    <!-- STATUS \/ ERROR MESSAGE --><\/p>\n<div id=\"base64-status\" style=\"margin-bottom: 15px; font-size: 0.85rem; font-weight: bold;\"><\/div>\n<p>    <!-- OUTPUT AREA --><\/p>\n<div>\n<div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;\">\n            <label style=\"color: var(--text-primary); font-weight: 700; font-size: 0.9rem;\">Output Result:<\/label><br \/>\n            <button id=\"copy-output-btn\" style=\"background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem;\">Copy to Clipboard<\/button>\n        <\/div>\n<p>        <textarea id=\"base64-output\" readonly placeholder=\"Result will appear here...\" style=\"width: 100%; height: 180px; padding: 15px; background: #0b1114; border: 1px solid var(--border); border-radius: 8px; color: #51cf66; font-family: monospace; font-size: 0.9rem; box-sizing: border-box; resize: vertical;\"><\/textarea>\n    <\/div>\n<\/div>\n<p><script>\n(() => {\n    const inputEl = document.getElementById(\"base64-input\");\n    const outputEl = document.getElementById(\"base64-output\");\n    const statusEl = document.getElementById(\"base64-status\");\n    const copyBtn = document.getElementById(\"copy-output-btn\");<\/p>\n<p>    \/\/ Helper: UTF-8 Safe Base64 Encode\n    const encodeBase64 = (str) => {\n        const bytes = new TextEncoder().encode(str);\n        const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join(\"\");\n        return btoa(binString);\n    };<\/p>\n<p>    \/\/ Helper: UTF-8 Safe Base64 Decode\n    const decodeBase64 = (base64) => {\n        const binString = atob(base64.replace(\/\\s+\/g, \"\"));\n        const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0));\n        return new TextDecoder().decode(bytes);\n    };<\/p>\n<p>    \/\/ ENCODE ACTION\n    document.getElementById(\"encode-btn\").addEventListener(\"click\", () => {\n        const input = inputEl.value;\n        statusEl.innerHTML = \"\";\n        if (!input) {\n            statusEl.innerHTML = \"<span style='color:#ffc107;'>Please enter text to encode.<\/span>\";\n            return;\n        }\n        try {\n            outputEl.value = encodeBase64(input);\n            outputEl.style.color = \"#51cf66\";\n            statusEl.innerHTML = \"<span style='color:#51cf66;'>\u2714 Successfully encoded to UTF-8 Base64.<\/span>\";\n        } catch (e) {\n            outputEl.value = \"\";\n            statusEl.innerHTML = \"<span style='color:#ff6b6b;'>Encoding Error: \" + e.message + \"<\/span>\";\n        }\n    });<\/p>\n<p>    \/\/ DECODE ACTION\n    document.getElementById(\"decode-btn\").addEventListener(\"click\", () => {\n        const input = inputEl.value;\n        statusEl.innerHTML = \"\";\n        if (!input) {\n            statusEl.innerHTML = \"<span style='color:#ffc107;'>Please enter a Base64 string to decode.<\/span>\";\n            return;\n        }\n        try {\n            outputEl.value = decodeBase64(input);\n            outputEl.style.color = \"#2ba6df\";\n            statusEl.innerHTML = \"<span style='color:#51cf66;'>\u2714 Successfully decoded Base64 string.<\/span>\";\n        } catch (e) {\n            outputEl.value = \"\";\n            statusEl.innerHTML = \"<span style='color:#ff6b6b;'>Decoding Error: Invalid Base64 input string. Ensure there are no invalid characters.<\/span>\";\n        }\n    });<\/p>\n<p>    \/\/ SWAP ACTION\n    document.getElementById(\"swap-btn\").addEventListener(\"click\", () => {\n        const temp = inputEl.value;\n        inputEl.value = outputEl.value;\n        outputEl.value = temp;\n        statusEl.innerHTML = \"<span style='color:var(--text-secondary);'>Swapped input and output values.<\/span>\";\n    });<\/p>\n<p>    \/\/ CLEAR INPUT\n    document.getElementById(\"clear-input-btn\").addEventListener(\"click\", () => {\n        inputEl.value = \"\";\n        outputEl.value = \"\";\n        statusEl.innerHTML = \"\";\n    });<\/p>\n<p>    \/\/ COPY TO CLIPBOARD\n    copyBtn.addEventListener(\"click\", async () => {\n        if (!outputEl.value) return;\n        try {\n            await navigator.clipboard.writeText(outputEl.value);\n            const originalText = copyBtn.textContent;\n            copyBtn.textContent = \"Copied!\";\n            copyBtn.style.color = \"#51cf66\";\n            copyBtn.style.borderColor = \"#51cf66\";\n            setTimeout(() => {\n                copyBtn.textContent = originalText;\n                copyBtn.style.color = \"var(--text-secondary)\";\n                copyBtn.style.borderColor = \"var(--border)\";\n            }, 1800);\n        } catch (err) {\n            alert(\"Failed to copy to clipboard.\");\n        }\n    });\n})();\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lint Docker Compose configurations against edge server best practices including timezones and restart rules.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":38,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-tool-base.php","meta":{"footnotes":""},"class_list":["post-8813","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Base64 Encode &amp; Decode Tool - Lukas Wojcik - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Base64 Encode &amp; Decode Tool - Lukas Wojcik - Blog\" \/>\n<meta property=\"og:description\" content=\"Lint Docker Compose configurations against edge server best practices including timezones and restart rules.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-05T16:31:56+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/base64-encode-decode-tool\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/base64-encode-decode-tool\\\/\",\"name\":\"Base64 Encode & Decode Tool - Lukas Wojcik - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-08-05T13:36:38+00:00\",\"dateModified\":\"2026-08-05T16:31:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/base64-encode-decode-tool\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/base64-encode-decode-tool\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/base64-encode-decode-tool\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Toolbox\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Base64 Encode &#038; Decode Tool\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"luky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"luky\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Base64 Encode & Decode Tool - Lukas Wojcik - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/","og_locale":"en_US","og_type":"article","og_title":"Base64 Encode & Decode Tool - Lukas Wojcik - Blog","og_description":"Lint Docker Compose configurations against edge server best practices including timezones and restart rules.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/","og_site_name":"Lukas Wojcik - Blog","article_modified_time":"2026-08-05T16:31:56+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/","name":"Base64 Encode & Decode Tool - Lukas Wojcik - Blog","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"datePublished":"2026-08-05T13:36:38+00:00","dateModified":"2026-08-05T16:31:56+00:00","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/base64-encode-decode-tool\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Toolbox","item":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/"},{"@type":"ListItem","position":3,"name":"Base64 Encode &#038; Decode Tool"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"luky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"luky"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/8813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=8813"}],"version-history":[{"count":1,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/8813\/revisions"}],"predecessor-version":[{"id":8819,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/8813\/revisions\/8819"}],"up":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/38"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=8813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}