Base64 to Word

Decode a Base64 string into a downloadable Word (.docx) file, or encode a .docx to Base64 — instantly and locally. A .docx is a ZIP archive (Office Open XML), so it starts with the PK header; the tool validates that. Nothing is uploaded.

BASE64 INPUT
Paste a Base64 string to begin

How to convert Base64 to a Word document

Paste the Base64 for your document into the box above — a full data URI (data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBB…) or just the raw payload both work. The tool decodes the bytes locally and checks that they begin with the PK signature that marks a real .docx. Click Download .docx to save the file as document.docx, then open it in Microsoft Word, Google Docs, or LibreOffice Writer. To go the other way, flip the toggle to Word → Base64 and drop a .docx onto the drop zone.

Why is a .docx a ZIP file?

A modern Word document uses the Office Open XML format, and every OOXML document is really a ZIP archive of XML parts — document.xml for the main body, plus styles, fonts, numbering, relationships, and any embedded media. That's why the decoded bytes always start with 50 4B, the two ASCII characters PK (the initials of ZIP's inventor, Phil Katz). If your decoded bytes don't start with PK, they aren't a valid .docx: an older .doc uses a different binary container, and an RTF is just marked-up text. The tool surfaces this check so you know before you try to open the file.

Decoding Base64 to Word in VBA / Office Scripts

You don't need a website to decode Base64 — Office can do it natively. In VBA, the trick is MSXML2.DOMDocument: create an XML node, set its DataType to bin.base64, assign your Base64 text to NodeTypedValue to get the raw bytes, then stream those bytes to disk with ADODB.Stream.

Sub Base64ToDocx(ByVal b64 As String, ByVal outPath As String)
    ' Decode a Base64 string to bytes via MSXML, then write the .docx
    Dim dom As Object, node As Object, stream As Object
    Set dom = CreateObject("MSXML2.DOMDocument")
    Set node = dom.createElement("b64")
    node.DataType = "bin.base64"
    node.Text = b64                       ' your Base64 string

    Set stream = CreateObject("ADODB.Stream")
    stream.Type = 1                        ' adTypeBinary
    stream.Open
    stream.Write node.NodeTypedValue       ' the decoded bytes
    stream.SaveToFile outPath, 2           ' adSaveCreateOverWrite
    stream.Close
End Sub

Call it with Base64ToDocx(myBase64, "C:\Temp\document.docx"). In modern Office Scripts / TypeScript you can instead decode with atob() into a Uint8Array. Either way, because the decode preserves every byte, the resulting file is identical to the original document.

Is this private?

Yes. Both directions run entirely client-side in JavaScript. When you decode, the Base64 is turned into bytes and a downloadable blob in the browser; when you encode, your .docx is read into memory with the FileReader API and encoded locally. The document is never sent to a server — which matters for confidential contracts, legal drafts, or HR letters. You can confirm it in DevTools → Network: converting fires no request.

Frequently asked questions

How do I convert a Base64 string to a Word document?

Paste your Base64 into the box above and click Download .docx. The tool decodes it to raw bytes locally, checks for the PK (ZIP) header of a valid .docx, and saves the result as document.docx — ready to open in Microsoft Word, Google Docs, or LibreOffice Writer.

Why does my Word file open as corrupted?

Usually the Base64 is truncated or picked up stray characters, so the decoded bytes are an incomplete ZIP and won't open. Confirm the bytes start with PK; if the tool warns there's no PK/ZIP header, the source may not be a .docx at all — it could be an older .doc, an RTF, or unrelated data.

How do I Base64-encode a Word document?

Switch to Word → Base64 mode and drop your .docx (or .doc) onto the drop zone. It reads the file locally and outputs the raw Base64 string, which you can copy into JSON, an API payload, a database column, or an email attachment field.

Can I decode Base64 inside Word itself?

Yes — a short VBA macro does it. Create an MSXML2.DOMDocument node with DataType = "bin.base64", assign your Base64 text to NodeTypedValue to get the bytes, then write them to disk with an ADODB.Stream. See the VBA snippet above for the full routine.

Need plain Base64 encode/decode?

The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.

Open base64.dev →