How to Extract Text From an Image Without Losing the Formatting
To extract text from an image without losing the formatting, keep the layout through the OCR step, then rebuild it in Word. Here is what survives and what does not.
You photograph a printed letter, run it through a text extractor, and get back a solid block of words. The paragraphs have merged into one another. The list that was neatly bulleted is now a run of sentences. The table that lined up in columns now reads across the rows, mixing the numbers from one column into the next. The words are all there, and the document is still unusable.
The frustration has a simple cause: an image holds pixels, not text, and the reading step — OCR, optical character recognition — returns words plus their positions, not a document. Some of the layout survives that step and some of it does not, and knowing which is which decides whether you get a clean document or an afternoon of retyping.
What OCR Actually Gives You
OCR reads the picture and returns two things: the words it recognized, and where each word sits on the page. A good tool keeps that position information and uses it to rebuild line breaks, paragraph breaks, and columns. A basic tool throws the positions away and hands you the words in reading order, which is where the solid block of text comes from.
That distinction is the first thing to check in any tool you use. A converter that advertises "keeps line breaks" is preserving the vertical position of each line; one that advertises "rejoins wrapped lines into paragraphs" is going further, deciding which line breaks were just the edge of the printed column and which were real paragraph breaks. Neither one preserves fonts, bold, italics, colours, or spacing, because plain text has nowhere to put them. If your goal is an editable document that looks like the original, the OCR step is only half the job — the other half is rebuilding the structure in Word, and this guide covers both halves.
Before you start, it helps to know what the image to text converter actually returns: editable text with line breaks, plus a confidence figure for the reading. The confidence figure matters more than it looks. OCR fails by inventing plausible text rather than by leaving gaps, so a low-confidence reading that still looks like prose is more dangerous than an empty one — nothing in it warns you that a digit or a name was invented.
What Survives, and What Does Not
| Formatting | Survives OCR? | What to do about it |
|---|---|---|
| Line breaks | Usually yes | Keep them, then rejoin wrapped lines (see below) |
| Paragraph breaks | Often, as blank lines | Check each one; a missed break merges two paragraphs |
| Bulleted and numbered lists | As lines, not as a list | Reapply the list style in Word |
| Tables | Only with a table-aware tool | Use the table extraction route, not plain OCR |
| Headings | As plain lines, same size as body text | Reapply heading styles by hand |
| Bold, italics, underline | No | Reapply after proofreading |
| Font, size, colour | No | Pick the document's fonts fresh in Word |
| Two-column layout | Only if you read one column at a time | Crop each column separately |
| Footnotes | As stray lines at the end | Move them back by hand |
The pattern is consistent: structure that lives in the positions of words can survive, and structure that lives in how the words look cannot. A heading is a heading because it is bigger and bolder than the body text, and both of those facts are visual — the OCR engine sees the letters, not the size. A table is a table because numbers line up in columns, and that is positional, so a table-aware tool can recover it while a plain-text tool cannot.
How to Extract Text From an Image Without Losing the Formatting in 6 Steps
Step 1: Straighten the photo and fill the frame
OCR is far more sensitive to focus, skew, and contrast than to resolution. A sharp, square, well-lit photo at a modest size beats a large blurry one every time. Straighten the page so the lines are horizontal, crop tightly to just the text you want, and fill the frame with the page. Crop out the desk, the clock, the battery icon, and the app buttons in a phone screenshot — OCR reads everything it sees, and every stray element becomes stray text you have to delete later.
If the page is a long scrolling screenshot of a chat or a web page, cut it into screen-height pieces first. Most tools scale the image so its longest side is at most 2000 pixels, and a long capture gets shrunk until the letters are tiny. Read the pieces one at a time and join them afterwards. Our guide to improving OCR accuracy covers the image preparation steps in detail.
Step 2: Choose plain text or Word before you run the OCR
Decide what the text is for, because the choice changes the workflow. If you need the words to paste into an email or a search box, plain text is enough, and you can stop after the next step. If you need a document that looks like the original — headings, lists, a table — choose the Word route now, not after you have already pasted plain text into a document and started fixing it by hand. Our guide to converting an image to a Word document covers the Word route end to end, and this guide uses it for the table and the list in your document.
Step 3: Run the OCR and keep the line breaks
Upload the image to the image to text converter and run the recognition. Take the result with its line breaks intact — do not accept a version that has already collapsed everything into one paragraph, because you cannot recover the breaks afterwards. Read the output against the image once, quickly, before you do anything else: check the headings, the first line of each paragraph, and every number. Numbers are where OCR errors hide, because a misread 1 for 7 still looks like a number.
Step 4: Rejoin the wrapped lines, keep the real breaks
Raw OCR output breaks a line wherever the source image did, which means a paragraph arrives as a stack of short fragments that no longer wrap when pasted anywhere else. The fix is to rejoin lines that are continuations of the same sentence, and keep the breaks that are real: blank lines between paragraphs, the line before a heading, and the lines of a list.
The rule of thumb is simple. If a line ends mid-sentence — no full stop, no colon, and the next line starts with a lower-case letter — it is a wrapped line, and the two belong together. If a line ends with a full stop and the next line starts with a capital letter, it is probably a new sentence, and if there is a blank line as well, it is a new paragraph. Work through the document once with that rule, and the solid block turns back into paragraphs. Hyphenated words need one extra look: if a word is split across lines with a hyphen, remove the hyphen and join the parts, but only when the word is genuinely one word — a hyphen that belongs to the word, as in "well-known", stays.
Step 5: Rebuild the structure in Word
Paste the cleaned text into a blank Word document, then rebuild the structure from the top down. Apply a heading style to the headings first, because everything else hangs off them. Then select each list and apply the bullet or numbered-list style — do not type the bullets by hand, or the list will not behave like a list when you edit it later. Then fix the paragraph spacing with the paragraph settings, rather than by pressing Enter twice between paragraphs, for the same reason: real paragraph spacing survives editing, empty lines do not.
Tables need their own route. If your document has a table, do not paste OCR text and try to line the columns up with spaces — that breaks the moment anyone edits a cell. Use the table extraction workflow in our guide to extracting a table from an image, which rebuilds the rows and columns from the word positions and checks the result against the totals, then paste the finished table into the document.
Step 6: Proofread the numbers, names, and dates last
Proofread last, after the structure is rebuilt, because proofreading first wastes effort on text you are about to move. Read the finished document against the image, and check every number, name, and date — those are the three things OCR gets wrong while still looking right. A name misread as a different real name, a date with the day and month swapped, and a total with one digit changed are all invisible to a spellchecker. Check the totals in any table against the original: if the column does not add up, a digit is wrong somewhere in it.
Two-Column Pages and Other Layout Traps
A two-column page is the most common layout trap, and it has a simple cause: OCR assembles text top to bottom, left to right, joining words on the same horizontal line. On a two-column page, a line from the left column and a line from the right column sit at the same height, so they get merged into one line that reads as nonsense. The fix is to crop each column separately and read them one at a time, then paste them in order. The same trick works for sidebars, captions, and any text that sits beside the main flow rather than in it.
A screenshot of a chat or a slide has the opposite problem: the lines are short and the breaks are real. Do not rejoin them into paragraphs, or a list of messages becomes one long sentence. Keep the line breaks, and keep the timestamps and names with their messages if you need the record to make sense later. Our guide to turning a screenshot into text covers screenshots specifically, including the long-capture problem.
Handwriting is a separate case entirely. Printed text and handwriting need different recognition, and a tool tuned for print will do badly on a handwritten note. If your image is handwriting, use the workflow in our guide to turning handwriting into text instead of the steps above — the preparation and the proofreading are both different.
Common Mistakes and How to Fix Them
Pasting plain text into Word and expecting layout
Plain text has no headings, no lists, and no tables. Pasting it into Word gives you a document-shaped block of words, not a document. Choose the Word route before you run the OCR, or rebuild the structure afterwards as Step 5 describes — either way, the rebuilding is a real step, not something the paste does for you.
Trusting the auto-formatting
Word's auto-formatting will turn some lines into lists and some text into headings on its own, and it will guess wrong about half the time. Turn it off for this job, or undo its guesses as they appear, and apply the styles yourself. A list that Word created by accident behaves differently from one you applied deliberately, and the difference shows up when you edit it.
Skipping the proofread because the text "looks right"
OCR fails by inventing plausible text, not by leaving gaps. A sentence that reads smoothly can still contain a wrong digit, a wrong name, or a swapped date, and no spellchecker catches those. The proofread in Step 6 is not optional — it is the step that makes the document trustworthy.
Reading a whole multi-page document in one go
A long document photographed page by page needs each page read separately, in order, with the page breaks kept. Reading all the pages at once, or joining them without checking the order, merges the end of one page into the start of the next. Our guide to reading scanned PDF pages covers multi-page documents, including how to keep the pages in order.
Frequently Asked Questions
Can OCR keep bold and italics?
No, not in plain-text output. Bold and italics are visual properties of the printed letters, and plain text has nowhere to record them. Some Word-route tools can detect bold and italic text and apply the styles, but the detection is unreliable, so expect to reapply emphasis by hand after proofreading. If the bold marks something important, such as a heading or a warning, reapply it first, before the body text.
Why did my paragraphs merge into one block?
Because the blank lines between them were lost. That happens when the photo is slightly skewed, so the blank line is not blank everywhere, or when the tool's cleanup pass rejoins lines too aggressively. Re-read the image with the line breaks kept, check the blank lines are really there in the photo, and rejoin only the wrapped lines as Step 4 describes.
Can I get a Word file directly from a photo?
Yes. The Word route reads the image, extracts the text, and builds a .docx file with the text as editable paragraphs, and with tables rebuilt where the tool supports them. Follow our guide to converting an image to a Word document for the full workflow, and expect to spend a few minutes reapplying heading and list styles afterwards — the file is editable, not finished.
Does the language of the document matter?
Yes. Pick only the languages actually present in the image before you run the OCR. Every extra language gives the recogniser more characters to confuse, so a scattergun selection usually makes the result worse. If the document mixes two languages, run it once per language on the relevant pages, or use the multilingual workflow in our guide to OCR in multiple languages.
References
- https://tesseract-ocr.github.io/tessdoc/ — The Tesseract OCR documentation: how the engine reads text, what layout analysis recovers, and why wrapped lines and columns need special handling.
- https://en.wikipedia.org/wiki/Optical_character_recognition — Optical character recognition, including the distinction between recognising characters and recovering document structure.