TXT to Word Converter
Convert TXT to Word in your browser without uploading your text. Paste text or select up to 50 files, with limits of 10 MB per input and 100 MB per batch. One input produces a .docx; multiple files produce a .zip.
Field notes from the harbor
The morning ferry was late again, so we waited on the pier and watched the gulls circle the fish market. Nobody minded much; the coffee stand had just opened.
Meeting notes
Plain text carries no styling at all, only words and line breaks, and that is exactly what this converter works from. Paste a chapter, a log excerpt or a pile of notes, keep an eye on the paragraph preview below, and download a Word document you can edit straight away.
What you see here is the split: each block becomes one paragraph in Word, and title and subheading blocks are drawn in a slightly larger type. It is here to confirm that the split is right, not to preview Word's layout — font, size, line spacing and where pages break have to be judged in Word itself.
🔒 The .docx is built in your browser, so your text is not uploaded and does not leave your device; the page does not remember your settings either.
How to use
- Paste your text or choose your files: Type or paste into the Plain text box — it opens with a short example you can replace. Or drop .txt, .text, .log, .md, .markdown or .csv files onto the box above it: up to 10 MB each, up to 50 files, 100 MB per batch. The drop zone stays on screen, so more files are added to the end of the list; click the ✕ on a row to take one out, and once the list is empty the text box comes back.
- Set the encoding and the paragraph mode: Leave Encoding on Detect automatically and the label shows what was detected; switch to UTF-8, GBK / GB18030 or UTF-16 if the preview looks wrong. Paragraph mode decides where paragraphs begin. Then set Document title / file name, page size, fonts, body size and line spacing, and turn on the two heading switches if you want them.
- Check the paragraph preview: The Paragraph preview under the settings is the real split: each block there becomes one paragraph in the .docx, and it counts the blocks for you. It is for structure only — the first 200 blocks are drawn, while the file you download is complete.
- Convert and save: Click Convert to Word, or Convert and pack when several files are selected, and use Download in the result card. On a phone, Save to device opens the system share sheet when the browser offers file sharing and otherwise downloads the file straight away. Changing any setting afterwards discards the result, so convert again.
How this TXT to Word converter works
TXT to Word takes plain text — pasted in, or read from .txt, .text, .log, .md, .markdown and .csv files up to 10 MB each — and writes an editable Word .docx. One file in gives one .docx; two or more give one .docx per file, packed into a single txt-to-word.zip. Up to 50 files per batch and 100 MB in total. Nothing is uploaded: the document is assembled on your device.
The path is short and entirely local. The page reads each file as raw bytes rather than as text, because the bytes are what the encoding detection needs, then decodes them with the browser's own TextDecoder, splits the result into paragraphs and assembles a standard Office Open XML package with docx.js 9.5.1 — the same container Word, WPS Office and Google Docs read. There is no server step for your content, no account, and no setting is remembered: close or reload the page and nothing is left behind. The one request involved is the converter code itself, which is fetched on the first conversion and cached after that; your text is not part of it.
Converting is a deliberate click, not a live export. Editing the text box, changing any setting, adding or removing a file, or pressing Clear discards the .docx that was generated before, so you can never download a file that disagrees with the settings on screen. The .docx and the .zip are both formats the result card cannot render, so it shows the file name with a note that the format can't be previewed here and a download button — open the file in Word to see it.
One detail is worth knowing before you download. The download name is built from the resolved document title: what you typed in Document title / file name, or else the name of the file you picked without its extension, or else document for pasted text. The file properties keep the title after leading and trailing whitespace is removed; filename-only characters such as colons are preserved. The download name goes one step further and replaces the characters a file name cannot hold with underscores, then cuts the stem to 80 characters. Type a:b and you download a_b.docx from a document still titled a:b.
Getting the encoding right so the text is not garbled
Check the text preview before converting. This converter supports UTF-8, UTF-16 and GB18030; if another encoding is used, reopen the file with the correct encoding in your editor and save it as UTF-8. With detection left on and a file selected, the Encoding label says what it settled on — detected as utf-8, utf-16le, utf-16be or gb18030 — so you can see which branch was taken before you press the button.
Decoding never raises an encoding error. Bytes that do not fit become the U+FFFD replacement character and travel straight into the document — the conversion is not blocked. The page watches for that instead: when replacement characters make up more than one in two hundred characters of the preview text, a warning tells you the guess was probably wrong and asks you to choose an encoding. Two limits on that warning are worth knowing. It is judged on the preview text, which is the first selected file or the text box, so a garbled second, third or fiftieth file in a batch is not flagged. And a wrong guess can produce no replacement characters at all, in which case nothing is flagged — only the preview itself will tell you.
A UTF-16 file with no byte order mark is the one case where the outcome splits in two, and the dividing line is whether there is a null byte in the first 4096 bytes rather than how short the file is or whether it is all Chinese. UTF-16 spells out spaces, line breaks, Latin letters and digits with a null byte each, so most such files hit the binary guard and come back refused as not plain text. Without a null byte in those first 4096 bytes, though, the file passes that guard. It is then decoded as UTF-8 if its bytes are valid UTF-8, otherwise as GB18030; either choice can misread the original text. Either way the fix is the same: set Encoding to UTF-16, which skips the null-byte scan and reads the file as little-endian unless it starts with a big-endian mark. Big5 and Shift-JIS have no option here; re-save those as UTF-8 first.
The technical reason detection surprises people: what picks the branch is the bytes themselves, not the encoding the file was saved in. Tested here, one GBK character stored as C2 A1 is also a valid UTF-8 sequence, so the file is read as UTF-8 and comes out as an inverted exclamation mark with no replacement character anywhere; two other GBK characters, stored as D6 D0 CE C4, really are invalid UTF-8, fall back to GB18030 and come out right. Latin-1 behaves the same way in both directions: C3 A9 passes the check and is read as an accented e, while the Latin-1 spelling of cafe with an accent ends in a truncated sequence, fails the check and falls back to GB18030 with a replacement character in place of the last letter. Length changes nothing — the same two mis-read Chinese characters repeated a thousand times take exactly the same branch.
| What you have | What automatic detection does | What to do |
|---|---|---|
| A file saved as UTF-8, with or without a BOM | Reads it as UTF-8 | Nothing — this is the normal case |
| Chinese text saved as ANSI in Notepad | Falls back to GB18030 only if the bytes fail the UTF-8 check; bytes that pass are read as UTF-8 and quietly come out as other characters | Check the preview; if it looks wrong, choose GBK / GB18030 |
| UTF-16 with a byte order mark | Reads the mark and decodes as utf-16le or utf-16be | Nothing |
| UTF-16 with no byte order mark | Refused as not plain text when the first 4096 bytes hold a null byte. Otherwise decoded as UTF-8 if valid, or GB18030 if not; the original UTF-16 text can be misread | Choose UTF-16 |
| Big5, Shift-JIS, KOI8 or Latin-1 | May be misread, may be refused — the bytes decide | Re-save as UTF-8 in your editor first |
The encoding branch is chosen from the bytes, not from the encoding the file was written in.
How plain text is split into Word paragraphs
Plain text has no paragraphs, only characters and line breaks, so the split has to be guessed and you get to pick the guess. Blank line starts a paragraph treats an empty line (or a line holding only spaces) as the break, and keeps the line breaks inside a block as Word soft line breaks, so a postal address or a stanza stays one paragraph with its own line layout. One paragraph per line makes every line its own paragraph and drops the empty ones. Smart, the default, splits on blank lines first; if that leaves a single non-empty block and that block holds at least three line breaks, it splits that block into one paragraph per line — which is exactly the one-entry-per-line log that would otherwise arrive as a single wall of text. Blank lines at the very start or end of the file do not prevent that switch, because empty blocks are dropped before the count; and a block with only two line breaks stays one paragraph.
Consecutive blank lines collapse into one break and produce no empty paragraph, whichever mode you use. This is worth stating plainly, because other converters promise the opposite: if you used three blank lines as a scene break, that gap is gone in the .docx and you will want a real page break or a separator line in Word instead. Windows CRLF and old Mac CR line endings are normalized to LF before the split, so a file saved on Windows does not gain doubled breaks.
Whitespace is trimmed per block, not per line, and the difference shows up in exactly one place. Leading and trailing whitespace is removed from the whole block, so in a multi-line block only the very start of the first line and the very end of the last line lose their spaces: ASCII tables, indented code and hanging indents inside the block survive. In One paragraph per line, however, every line is its own block, so every line loses its own leading and trailing spaces — the classic two-space paragraph indent disappears in that mode. Keeping the indentation of every single line is not something this converter can do.
The Paragraph preview is the same splitter the conversion uses, not a second implementation, so the number of blocks and where they begin is what you will find in Word. It draws the first 200 blocks and says so when there are more; the downloaded file is never truncated. What the preview is not is a layout preview — fonts, sizes, line spacing and where pages break have to be judged in Word itself.
| Your text looks like | Pick | What you get |
|---|---|---|
| An article or chapter with blank lines between paragraphs | Smart, or Blank line starts a paragraph | One Word paragraph per block, with soft line breaks inside it |
| A log or export with one entry per line and no blank lines | Smart | Falls back to one paragraph per line, because there are at least three line breaks |
| An address list, a poem or a checklist where each line matters | One paragraph per line | Every line is a paragraph, and each line's own leading spaces are trimmed |
| A couple of lines with no blank line between them | One paragraph per line | Smart keeps it as a single paragraph here — fewer than three line breaks is below its fallback threshold |
Which paragraph mode fits which kind of text file.
If your text turns out to have # headings, tables or lists that should become real Word structure, those are markup and this page writes them as literal characters — use Markdown to Word Converter instead.
Converting a folder full of text files at once
Select two or more files and the page switches to batch mode: the button reads Convert and pack, the list shows how many files are queued, and Document title / file name is disabled because each file uses its own name. Every file is converted on its own, in list order, with the same encoding, paragraph mode, fonts and spacing, and the finished documents are zipped into one txt-to-word.zip. Two guards decide what gets in: at most 50 files, and at most 100 MB across the batch. Files beyond the count are not added and the page says so, and files that would push the total over the limit are skipped one by one with a count — larger ones can be skipped while smaller ones later in the list still fit. Nothing is dropped silently.
A single bad file does not stop the rest. The converter records which file failed and why, carries on with the next one, and puts the successful documents in the archive; a notice then names up to three of the files that failed, with the reason. If every file fails there is no archive at all, only that message. One failure mode does take everything with it, though: if the zipping step itself fails after the documents were built, the page reports that the document could not be generated and nothing is downloadable, so there is no partial archive to salvage.
Names inside the archive are the source file names with .docx in place of the old extension, cleaned up on the way in. Control characters are removed, trailing dots and spaces are stripped, and the stem is cut to 120 UTF-16 code units; a name that cleans up to nothing becomes a fallback stem, and a name matching a reserved Windows device name such as CON or NUL gets an underscore in front. Duplicates do not overwrite each other — the second gets (2) appended, and names that differ only in capitalization count as duplicates — so notes.txt and notes.log arrive as notes.docx and notes (2).docx. That suffix and the extension are added after the 120-unit cut, so a de-duplicated entry name can run a few characters longer.
Folders are allowed: drop one onto the box and it is walked recursively, so a year of exported chat logs can go in at once. If your browser can only read part of what you dropped, the whole drop is refused and the unreadable items are named, on the principle that part of a folder is not the folder. Files whose extension is not accepted, or that are over 10 MB, are filtered out one by one with a count, and the files that do qualify are added as usual.
What the .docx keeps, what it changes, and what it will not do
The text itself comes through as Unicode, untouched: Chinese, Japanese and Korean characters, emoji and Vietnamese tone marks all survive, provided the encoding was read correctly. Line breaks inside a paragraph become real Word soft line breaks rather than new paragraphs. Characters that matter to XML, such as < > and &, are escaped properly and do not damage the file. Nothing identifying you is written — the author field in the file properties is left at the converter library's own placeholder, not your name.
Word keeps a separate font slot for Chinese, Japanese and Korean characters, and setting only a Latin font is the usual reason CJK text turns into boxes elsewhere. This converter writes both slots on every run of text, so the Latin font — Calibri by default, with Arial, Times New Roman and Georgia available — covers Latin letters while the East Asian font covers CJK characters, with SimSun by default and Microsoft YaHei, DengXian, FangSong, SimHei and KaiTi available. Fonts are referenced, not embedded, so if you pick KaiTi and the person opening the file has not installed KaiTi, Word substitutes something else. In an all-Latin document the setting makes no visible difference.
The layout you can control is page size (A4 at 11906 by 16838 twips, or Letter at 12240 by 15840, both portrait), body size (10.5, 12, 14 or 16 pt, 12 by default) and line spacing (single, 1.5 or double). The rest is fixed: one-inch margins on all four sides and 6 pt of space after each paragraph, with no control for either, and no first-line indent.
Title and subheading lines use the body font size. That is the plain warning the two heading switches deserve, because they do less than their names suggest: First line as a title lifts the first non-empty line out and gives it Word's Title style, Treat short lines as subheadings gives qualifying lines Heading 2, and in both cases only the style name is written. Every run of text, headings included, carries an explicit font size, and direct formatting beats a style in Word.
Short-line detection requires one line of no more than 20 Unicode code points. The line also has to stand alone as its own paragraph and must not end with one of the punctuation marks checked by this tool, such as a period or a colon. Note that an emoji can take several code points, so twenty visible emoji may be over the limit; other punctuation, such as an em dash, does not prevent heading detection.
To enlarge a heading, select it in Word and change its font size directly — editing the Title or Heading 2 style will not win against the direct formatting. Heading 2 does inherit its blue color from the style; the Title line stays black and unbolded. Tested on the output, no paragraph carries an outline level and neither do the style definitions, so those lines will not show up as entries in Word's navigation pane or in a table of contents.
Finally, what this page will not do. It does not read markup of any kind: #, **bold** and | table | arrive as literal characters. It produces no table of contents, page numbers, headers, footers, page breaks, columns, tables or bullet lists, because plain text carries none of that, and a line starting 1. stays ordinary text rather than becoming Word numbering. There is no password, watermark or usage limit on the output, and no cancel button once a conversion starts. A file that is not really text is caught by the converter's own guard rather than guessed from its extension: it refuses content starting with the ZIP/OOXML, %PDF, PNG, GIF, OLE2 or JPEG signatures, and — except when the encoding in use is UTF-16, whether from the file's byte order mark or because you chose it — content with a null byte in its first 4096 bytes. That covers a .docx or a PDF renamed to .txt, and usually covers a WebP, BMP, MP3 or 7z too, but it is not a blanket promise: a file whose first 4096 bytes hold no null byte, or one converted with UTF-16 selected, is treated as text and produces a document full of garbled characters.
Going the other way — a Word document you want back as plain text — is Word to TXT Converter, and it is also what to use when this page refuses a .docx you renamed to .txt.
How this tool is checked
- The logic behind this tool is covered by 44 automated test cases (hand-checked examples, edge cases and invalid input), and they run again before every release.
- Before each release, a real browser opens this page, runs it on sample files (including a damaged one) and checks the file it produces.
- Your files are processed in your browser and are never uploaded to our server.
- Formulas, figures and definitions are checked against the sources listed at the end of this page.
Frequently asked questions
- Is my text uploaded to a server?
- No. The file is read, decoded and packed into a .docx inside your browser, with no server step for your content. Nothing is stored either, so closing or reloading the page leaves nothing behind. The only request involved is the converter code itself, fetched once on the first conversion.
- Why does my Chinese or accented text come out garbled?
- Because the encoding was guessed from the bytes and the guess was wrong. A .txt file does not record its own encoding, so detection checks for a byte order mark, then whether the file is valid UTF-8, and otherwise falls back to GB18030. Set Encoding to UTF-8, GBK / GB18030 or UTF-16 yourself and the preview will show whether it reads correctly.
- How do I batch convert TXT files to Word?
- Select up to 50 text files, with no more than 10 MB per file and 100 MB in total, then click Convert and pack. You get one .docx per file inside a single txt-to-word.zip, and files over the count or the total are skipped with a count rather than silently dropped. Dropping the folder that holds them works as well — it is walked recursively, subfolders included.
- Does it keep my line breaks and blank lines?
- Line breaks inside a paragraph are kept as Word soft line breaks, so addresses and poems hold their shape. Blank lines are a different matter: they act as the paragraph break and several in a row collapse into one, producing no empty paragraph. If you used blank lines as a visible gap, add a page break or separator in Word afterwards.
- Why isn't the first line bigger in Word after I turned on the title switch?
- Because only the style name is written, not a larger size. Every run of text carries an explicit font size, and in Word direct formatting beats a paragraph style, so the Title and Heading 2 lines come out at body size. They also carry no outline level, so they do not appear in the navigation pane or a table of contents. Restyle those lines in Word.
- Can I convert a Word document back to plain text here?
- Not on this page — it only goes from plain text to Word. A .docx renamed to .txt is refused, because the converter recognizes the ZIP signature every .docx starts with and reports that the content is not plain text. Use the Word to TXT tool for that direction.
- Which files can I pick besides .txt?
- The drop zone accepts .txt, .text, .log, .md, .markdown and .csv, plus anything the browser reports as text/plain. Note that .md is read as plain text only: # headings, lists and tables become literal characters rather than Word structure, so use the Markdown to Word tool if you want real headings and tables.
- What happens if one file in a batch fails?
- The rest still convert. The failed file is left out of the archive and the page names up to three failures with the reason. If every file fails there is no archive at all. One exception: if the zipping step itself fails, the page reports a generation failure and nothing can be downloaded.
Related tools
Cite this tool
Using a result in a report, paper or assignment? Copy a ready-made reference.
Gingertool. (2026). TXT to Word Converter [Online tool]. Retrieved December 2, 2026, from https://gingertool.com/en/file-tools/txt-to-word/
“TXT to Word Converter.” Gingertool, December 2, 2026, https://gingertool.com/en/file-tools/txt-to-word/. Accessed December 2, 2026.
@misc{gingertool-txt-to-word,
author = {{Gingertool}},
title = {TXT to Word Converter},
year = {2026},
url = {https://gingertool.com/en/file-tools/txt-to-word/},
note = {Accessed: 2026-12-02}
}