Extra Gaps After Translating Word? Check Paragraph Spacing

An empty paragraph does not have spacing explicitly set, nor can it be assumed to be harmless; style inheritance, section breaks, and drawing objects may all af

Translated Word files sometimes show large blank gaps, or paragraphs that sit at uneven distances. This guide is for translators, editors and anyone who checks a translated Word file before it goes out.

The cause is often not the translation itself. Many people add space by pressing Enter several times in the original, and those empty paragraphs carry formatting that survives processing and can even grow. Deleting the visible blank lines rarely fixes the problem for good.

Below you will learn why empty paragraphs are unreliable, how Word combines paragraph spacing, which line-spacing settings to check, and which acceptance criteria tell you what to fix automatically and what to review by hand.

They do not guarantee results for every real file or product. Keep your original copies, and check results against the criteria in this guide before you process important documents.

Why do extra gaps appear after translating Word? The short answer

The gaps usually come from empty paragraphs and paragraph spacing settings in the source file, so check and standardise space_before, space_after and line_spacing rather than deleting blank lines by hand.

Your situationWhat to doWhy
Large blank space on translated pagesInspect paragraph_format in the source fileEmpty paragraphs keep their own spacing, which can be amplified during processing
An empty paragraph is used for layoutMove its spacing into space_after of the preceding paragraph, then delete itEmpty paragraphs are independent blocks and may be recalculated after translation
Two adjacent paragraphs both have spacingRemember that Word uses the larger valueWord collapses spacing to the maximum, not the sum
line_spacing returns NoneDo not treat it as zero; check the parent styleNone means the value is inherited from the style
Pages break in different places after translationKeep keep_with_next and page_break_before, and check content lengthThese attributes are retained through processing

Why empty paragraphs cause layout problems

Empty paragraphs are not harmless

An empty paragraph does not have spacing explicitly set, and you cannot assume it is harmless. Style inheritance, section breaks and drawing objects may all affect its layout. This guide records only direct attributes. Empty paragraphs are not removed automatically, and None values are not converted to zero.

When you translate a document with consecutive carriage returns in it, the following happens:

  • Each empty paragraph keeps its own line height and spacing before and after.
  • Each one may inherit styles from its surroundings.
  • The translation engine or CAT tool may treat it as a valid unit.
  • Longer translated text can reflow the surrounding paragraphs, so the fixed height of the empty line no longer fits.

Paragraph spacing versus blank lines

In Word's object model, a paragraph is a block-level element, and its position is controlled by the ParagraphFormat object. Use space_before (space before the paragraph) and space_after (space after the paragraph) to set spacing. Both accept Pt and Cm length units.

According to the python-docx documentation, when two adjacent paragraphs both have spacing set, Word's rendering engine applies a collapse rule. It takes the larger of the preceding paragraph's space_after and the following paragraph's space_before as the actual spacing, rather than adding them together.

This has two consequences:

  • Deleting an empty paragraph may not change the visual spacing at all.
  • You must also check the attribute values of the adjacent paragraphs.

To fix layout spacing properly, convert each empty paragraph used for layout into the space_after value of the preceding paragraph. Make sure that value accounts for the collapse rule.

Line-spacing pitfalls to check

Explicit zero versus inherited values

A None value means "inherited from the style", and it is easy to miss during batch processing. Suppose the parent style defines a large space after, and the current paragraph does not override it. Reading paragraph_format.space_after directly then returns None. A validation script may wrongly report zero spacing, even though the rendered page has substantial whitespace.

When you write check logic, clearly separate:

  • a value explicitly set to 0, and
  • a None value inherited from the style.

Line-spacing rule mismatches

If line_spacing is set to a floating-point number but the rule is EXACTLY, or the reverse, Word may fall back to default single spacing or produce overly large line heights. Watch for mismatches like these, especially in templates and generated code.

A synthetic example of spacing validation

The following Python example builds a document with proper spacing, erroneous blank lines and edge cases, and shows the expected validation output. It illustrates how to read the properties and make the judgement. It is not a complete repair tool.

Before you run it, install the python-docx library (version 0.8.11 or later is recommended). If you use the built-in test data, you do not need any other files. The code builds its inputs in memory, and the runtime logs are provided only as illustrations. They do not guarantee results for real-world files.

from docx import Document
from docx.shared import Pt
doc = Document()
title = doc.add_paragraph("Title")
title.paragraph_format.space_after = Pt(12)
explicit = doc.add_paragraph("")
explicit.paragraph_format.space_after = Pt(24)
inherited = doc.add_paragraph("")
def inspect(p):
    return {"empty_text": not p.text.strip(),
            "space_after_direct": p.paragraph_format.space_after,
            "needs_style_review": p.paragraph_format.space_after is None}
assert inspect(title)["space_after_direct"] == Pt(12)
assert inspect(explicit)["empty_text"]
assert inspect(explicit)["space_after_direct"] == Pt(24)
assert inspect(inherited)["needs_style_review"]
assert len(doc.paragraphs) == 3

The function inspect_paragraph_spacing only diagnoses. It does not modify the document. For paragraphs flagged as SUSPECT_LAYOUT_EMPTY_PARA, remediate as follows:

  1. Find the preceding non-empty paragraph.
  2. Merge the empty paragraph's spacing into that paragraph's space_after, taking the collapse rule into account.
  3. Delete the empty paragraph.

If line_spacing is None but rule has a value, be careful. The renderer may produce unexpected line heights.

Acceptance criteria and manual review boundary

Automation can fix inconsistencies at the attribute level, but it cannot replace an understanding of what the layout is meant to do. The table below lists the criteria, the processing decision for each, and the cases that need manual review. It summarises the behaviour of python-docx attributes and does not reflect the built-in detection of any particular software.

ObservationCode-level representationProcessing decisionManual review trigger
Excessive whitespace between paragraphsspace_after > 24pt, or consecutive empty paragraphs existMerge spacing automatically or delete empty segmentsThe original really needs large gaps, such as in poetry or forms
Visual anomaly in line spacingline_spacing_rule is EXACTLY but the value is too smallWarn and recommend changing to AT_LEASTLines contain embedded formulas or images
Attribute returns NoneNot set directly; inherited from the styleKeep as is; do not force a default valueThe style chain is broken or merged across documents
Translation causes pagination errorskeep_with_next or page_break_before is TrueKeep these attributes; check only content lengthThe title and body text are forced apart
Uneven spacing between list itemsThe list style overrides direct formattingRespect the style definitionManual numbering is combined with automatic lists

Checklist for translated Word documents

Translated Word files often mix content problems with formatting problems. Keep the spacing checks in this guide separate from checks on styles, headers, tables and other elements. That way, reviewers know where to look for each kind of problem.

OmniDoc translates PDF, Word, PowerPoint and Excel files: scanned pages are recognized first, table cells are translated one by one so tables keep their rows and columns, and a PDF comes back as both a bilingual and a translation-only file. Paid translation adds a glossary and context translation. Evaluate it with your own real-world samples:

  • Check the results against the checklist in this guide.

📊 At a glance

Empty paragraphs and spacing attributes handle layout in different ways:

AspectEmpty paragraphspace_after on the preceding paragraph
Spacing controlIts own line height plus spacing before and afterSet explicitly on the paragraph
Behaviour during translationMay be treated as a unit or recalculatedStays with its paragraph
Recommended for layout spacingNoYes, after accounting for the collapse rule

🎯 Which approach fits you?

If you see large gaps on translated pages

Inspect the paragraph spacing attributes in the source file before deleting anything. Then follow the remediation steps above.

If your source has many blank lines for layout

Convert the blank lines into space_after values on the preceding paragraphs, and delete the empty paragraphs. Check the result against the acceptance criteria.

If your layout includes poetry, forms or formulas

Expect some large gaps or unusual line heights to be intentional. Send these cases to manual review rather than automatic merging.

❓ FAQ

1. Why does deleting blank lines not always remove the gap?

Word collapses adjacent spacing to the larger value, so an empty paragraph may not be what creates the visible space. Check the space_after and space_before values of the neighbouring paragraphs too.

2. What does a None value for space_after mean?

It means the value is inherited from the paragraph's style. It does not mean zero. A paragraph can show substantial whitespace even when space_after reads as None.

3. Which spacing units can I use with space_before and space_after?

You can use Pt and Cm length units.

4. Should I let a script delete every empty paragraph?

No. Automatic merging suits most cases, but intentional whitespace in poetry, forms or documents with formulas and images should go to manual review.

📝 Summary

Extra gaps after translation usually come from empty paragraphs and paragraph spacing settings in the source file. Inspect and standardise those settings, and check the results against clear criteria before you publish.

Try it now: upload a document and get it translated with the layout intact

Updated 2026-11-29