Formatting Plain Text in Word After Converting TXT to DOCX

Oleh FileConvertLab

Diterbitkan: | Diperbarui:

Formatting plain text in Word: a TXT file turned into a DOCX with headings, bold and italic text, lists, tables and styles
Illustration showing a plain TXT file with uniform monospace text on the left being transformed into a professionally formatted DOCX Word document with headings, styled paragraphs, and visual hierarchy on the right

Plain text that lands in Word looks flat: one font, no headings, lists that are just hyphens, tables held together by tabs. Fixing it takes six steps, in this order: clean up the line breaks, mark the headings with styles, turn typed bullets and tab-separated rows into real lists and tables, set the body style once, then add page numbers and a table of contents. If you don't have the .docx yet, the TXT to DOCX converter makes one; this guide starts once the text is in Word.

Step 1: Show Paragraph Marks Before You Format Plain Text

Press Ctrl+Shift+8 (Cmd+8 on Mac), or click the button on the Home tab. Now you can see what you're working with:

  • ¶ at the end of every line — each line is its own paragraph. That's what you get when you open a .txt in Word directly or paste text copied from an email
  • ↵ (a bent arrow) — a manual line break inside one paragraph, typical of text pasted from web pages
  • ¶ only between real paragraphs — the text is already in shape. A DOCX from our converter looks like this, because it joins wrapped lines and starts a new paragraph only where the text file had a blank line
  • → arrows — tabs, usually the remains of a table or indentation

Leave the marks on while you clean up. You'll turn them off at the end.

Step 2: Clean Up Line Breaks in Word With Find and Replace

Open Find and Replace with Ctrl+H. Word uses codes for invisible characters: ^p is a paragraph mark, ^l a manual line break, ^t a tab.

Every line is a paragraph, real paragraphs are separated by an empty line. Three replacements rejoin them:

  1. Replace ^p^p with ### — a placeholder that marks the real paragraph breaks
  2. Replace ^p with a single space — joins the broken lines
  3. Replace ### with ^p — puts the real breaks back

Manual line breaks inside paragraphs. Replace ^l with a space.

Empty paragraphs used as spacing. Replace ^p^p with ^p, and run it until Word reports zero replacements. You'll add proper spacing in step 5.

Double spaces. Replace two spaces with one, repeat until nothing is found.

Tabs or spaces at the start of lines. Replace ^p^t with ^p. For leading spaces, tick Use wildcards and replace ^13 {1,} with ^p.

Run these on a copy first if the document matters. Undo (Ctrl+Z) reverses each replacement in one step.

Step 3: Apply Heading Styles, Not Bold Text

Headings are the single biggest improvement you can make to converted text. Click in a title line and apply a style:

StyleWindowsMac
Heading 1Ctrl+Alt+1Cmd+Option+1
Heading 2Ctrl+Alt+2Cmd+Option+2
Heading 3Ctrl+Alt+3Cmd+Option+3
NormalCtrl+Shift+NCmd+Shift+N

Use styles instead of making lines bold and bigger. A heading style shows up in View → Navigation Pane, lets you drag whole sections around, and feeds the table of contents in step 6. Bold text does none of that.

Titles typed in CAPITALS? Select them and press Shift+F3 until they cycle to Title Case or sentence case.

Step 4: Turn Typed Bullets and Tab-Separated Text Into Real Lists and Tables

Lists

Text files fake lists with -, * or 1. at the start of each line.

  1. Select the lines and click Bullets or Numbering on the Home tab
  2. Remove the typed characters: Find ^p- (paragraph mark, hyphen, space), Replace with ^p. Do the same for *
  3. Fix the first item by hand if it still has its hyphen

If the whole list ended up as one paragraph — "Action items: - Anna… - Marc…" — the list items weren't on separate lines in the paragraph sense. Put the cursor before each hyphen and press Enter, or replace space-hyphen-space with ^p within the selection only.

Tables

  1. Select the tab-separated lines
  2. Insert → Table → Convert Text to Table
  3. Under Separate text at, choose Tabs and check the column count Word proposes
  4. Style it from Table Design

Columns lined up with spaces instead of tabs? Select the block, tick Use wildcards, and replace " {2,}" (a space followed by {2,}) with ^t. Every run of two or more spaces becomes a tab, and Convert Text to Table works.

Step 5: Set the Body Font and Paragraph Spacing the Right Way

Don't select everything and pick a font. Set it in the Normal style so every paragraph follows along — including the ones you add later.

  1. Clear direct formatting first: Ctrl+A, then Ctrl+Space. This matters for a DOCX from the TXT to DOCX converter: it applies Calibri 11 pt directly to the text, and direct formatting overrides the style
  2. Right-click Normal in the Styles gallery → Modify
  3. Pick the font and size
  4. Format → Paragraph: set Spacing After (6–10 pt is typical) and line spacing

Now paragraphs are separated by real spacing, not empty lines, and changing the look later is a one-place edit.

Step 6: Add Headers, Page Numbers and a Table of Contents

  • Page numbers: Insert → Page Number → pick a position
  • Header or footer: Insert → Header or Footer; add the title, author or date
  • Table of contents: put the cursor at the top, then References → Table of Contents. It lists every Heading 1–3 from step 3; after edits, right-click it → Update Field
  • Title page: Insert → Cover Page, or just a Title-styled line and a page break (Ctrl+Enter)

Turn the ¶ marks off and check the document at 100% zoom.

Formatting Code, Logs and Other Monospaced Text

Code and logs need the opposite of prose: every line kept, no reflowing, a monospaced font.

  • Create a style for it: Styles → Create a Style, name it "Code", set Consolas or Courier New at 9–10 pt, Spacing After 0
  • Apply it to the code lines; leave everything else in Normal
  • Indentation matters in code, and our TXT to DOCX converter strips spaces at the start of lines. For code-heavy text, open the .txt in Word directly or use TXT to ODT, which keeps every line in a monospaced style

Formatting Plain Text in Google Docs and LibreOffice Writer

Google Docs: heading shortcuts are Ctrl+Alt+1/2/3 (Cmd+Option on Mac); Format → Paragraph styles → Normal text → Update to match sets the body style. Find and replace can't match paragraph breaks, so rejoin broken lines in Word or a text editor first.

LibreOffice Writer: tick Regular expressions in Find & Replace. $ matches the end of a paragraph, \n in the Replace box inserts a paragraph break. Headings: Ctrl+1/2/3. Tables: Table → Convert → Text to Table.

Save Time Next Time: a Template

If you convert plain text regularly, format one document fully, then File → Save As → Word Template (.dotx). Next time, open the template and paste the new text with Paste Options → Keep Text Only: the text takes on your styles immediately, and only the headings and lists need your attention.

Troubleshooting Formatting After TXT to DOCX

The font won't change when I modify the Normal style. Direct formatting is winning. Select all, press Ctrl+Space, and the style applies.

My headings don't appear in the Navigation Pane. They're bold text, not heading styles. Apply Heading 1 or 2.

Convert Text to Table gives one column. The columns are separated by spaces, not tabs. Use the wildcard replacement from step 4.

Replacing ^p^p did nothing. Your blank lines contain spaces. Replace ^w^p with ^p first (^w is any white space), then try again.

I need a PDF of the finished document. Save as PDF from Word, or use Word to PDF. For what can go wrong on the way, see the Word to PDF guide.

Summary

Formatting plain text in Word is mostly about structure, not looks: clean line breaks with ^p and ^l, heading styles instead of bold, real lists and tables, and one Normal style that controls the body. Do those four and the document is ready in minutes. For what a DOCX holds under the hood, see the DOCX format guide; if the text started in LibreOffice, ODT to DOCX covers moving it to Word.

Related Tools

Pertanyaan yang Sering Diajukan

How do I remove line breaks from pasted text in Word?

Open Find and Replace with Ctrl+H. Replace ^p^p with a placeholder such as ###, then replace ^p with a space, then replace ### with ^p. Manual line breaks are ^l and can be replaced with a space directly.

How do I add headings to a plain text document in Word?

Click in each title line and apply Heading 1, 2 or 3 from the Styles gallery, or press Ctrl+Alt+1, 2 or 3 on Windows and Cmd+Option+1, 2 or 3 on Mac. Heading styles appear in the Navigation Pane and in an automatic table of contents.

Why doesn't changing the Normal style change my converted text?

The font is applied directly to the text, which overrides the style. Select everything, press Ctrl+Space to clear character formatting, and the Normal style takes effect.

How do I turn tab-separated text into a table in Word?

Select the lines, choose Insert, Table, Convert Text to Table, and set Separate text at to Tabs. If the columns use spaces, first replace runs of two or more spaces with a tab using wildcards.

How do I turn lines starting with hyphens into a bulleted list?

Select the lines and click Bullets on the Home tab, then use Find and Replace to replace a paragraph mark followed by a hyphen and space with just a paragraph mark. Fix the first item by hand.

Can I format plain text the same way in Google Docs?

Headings and the body style work the same way through Format, Paragraph styles. Google Docs cannot match paragraph breaks in Find and replace, so rejoin broken lines in Word or a text editor first.

How do I keep code indentation when formatting text in Word?

Open the text file in Word directly or paste it, so leading spaces survive, then apply a custom monospaced style such as Consolas 10 pt with no spacing after paragraphs.