How address window positioning works on Royal Mail standard envelopes.
1/23/2026In the digital world, routing a message to its intended destination is an invisible, programmatic operation: you write an email address into an HTTP header, and the Simple Mail Transfer Protocol (SMTP) handles packet routing across TCP/IP networks.In physical postal logistics, however, routing depends entirely on mechanical optics and spatial physics.Every working day across the United Kingdom, Royal Mail processes tens of millions of letters using high-speed automated Optical Character Recognition (OCR) sorting machines. These industrial machines—costing millions of pounds—transport envelopes along mechanical conveyor belts at speeds exceeding thirty thousand envelopes per hour, capturing high-resolution digital scans of each envelope within milliseconds.If your letter is enclosed inside a window envelope, the machine does not open the envelope to see who it is addressed to. It scans the transparent cellophane window aperture on the front of the envelope. If the address block is printed in the correct spatial zone with high visual contrast, the machine reads the postcode, applies a machine-readable 2D Mailmark barcode, and directs the envelope into the appropriate regional dispatch chute.However, if your address block is misaligned by even five millimeters—if it is positioned too high, too close to the edge, or obscured by envelope folding—the high-speed optical scanner fails. The envelope is immediately rejected and dumped into a physical manual sorting bin.For businesses and software developers, address window misalignment is an expensive, embarrassing nightmare. Delivery is delayed by three to five working days while postal staff attempt manual inspection. If the address is partially obscured, the letter is marked undeliverable and returned to sender weeks later. Critical statutory legal notices miss strict court deadlines, overdue invoice notices arrive too late, and thousands of pounds in postage and printing costs are completely wasted.Philosophically, software developers building document generation systems should not have to spend weeks guessing envelope dimensions, manually measuring paper folds with plastic rulers, and fighting with CSS margin millimeter offsets. Clean, standardized geometry rules should govern every programmatic document.At LetterAPI, we have manufactured and dispatched millions of physical letters through the Royal Mail network. We have calibrated our printing and folding systems to the exact millimeter specifications required by Royal Mail sorting automation. In this definitive technical guide, we break down the exact spatial geometry of UK window envelopes (DL and C5 formats), explain left-window versus right-window layouts, provide copy-paste CSS print templates, and show you how to guarantee 100% optical sorting compliance for every letter you send.
The two standard UK envelope formats: DL vs C5
When designing physical letters for UK business correspondence, developers primarily work with two standardized envelope formats:1. The DL Window Envelope (110mm x 220mm): DL is the undisputed standard for UK corporate, financial, and legal correspondence. It is designed to accommodate a standard A4 sheet (210mm x 297mm) folded into thirds using a 'letter fold' (C-fold or Z-fold). Because DL envelopes fall under Royal Mail's 'Standard Letter' pricing tier (up to 100g and 5mm thickness), they represent the most cost-effective format for automated mailings at just £0.86 per letter.2. The C5 Window Envelope (162mm x 229mm): C5 is designed to hold an A4 sheet folded in half once (or multiple unfolded A5 sheets). It is commonly used for multi-page documents (5 to 25 pages), bulky legal bundles, or transactional statements with thick brochures. While C5 envelopes offer greater page capacity, they fall into Royal Mail's 'Large Letter' postal classification, carrying higher postage tariffs.For 95% of automated business mailings—invoices, arrears notices, dunning letters, onboarding welcomes, and verification codes—the DL window envelope is the optimal commercial choice.The spatial coordinates of the Royal Mail DL window aperture
To ensure that your document's address block is perfectly visible through a standard UK DL window envelope, your print template must adhere to strict spatial coordinates on the first page of the A4 document.When an A4 sheet is folded into thirds, the top third of the page sits directly behind the envelope's clear cellophane window. Here are the exact millimeter specifications:Top Margin Offset: The address block must begin exactly 40mm down from the top edge of the A4 sheet. This ensures that when the page is folded, the first line of text does not get clipped by the top edge of the window aperture.Left Margin Offset: In the United Kingdom, standard corporate window envelopes use a 'left-hand window'. The address block must begin exactly 20mm in from the left edge of the A4 sheet.Window Dimensions: The standard DL window aperture measures 90mm wide by 45mm tall.The Clear Quiet Zone: Royal Mail optical sorting standards require a minimum 5mm 'quiet zone' of clear white paper surrounding the address block on all four sides inside the window aperture. No corporate logos, return addresses, decorative rules, or background shading may intrude into this zone.Maximum Address Block Dimensions: Accounting for the 5mm quiet zone, the active text area for the recipient address must fit within an 80mm wide by 35mm tall bounding box.Left-window vs right-window: The UK vs US standard trap
A dangerous trap for international software development teams is the difference between British and American envelope standards.In the United States, commercial #10 envelopes almost universally position the address window on the left side, but with significantly different vertical and horizontal offsets than UK DL envelopes (US #10 windows are typically 12.7mm from the bottom and 22.2mm from the left).Furthermore, in certain European countries (such as Germany and France), corporate stationery occasionally utilizes 'right-hand window' envelopes (following DIN 680 standards).If an international software team applies an American or continental European template to UK commercial print fulfillment, the address block is printed on the wrong side or at the wrong height. When inserted into a standard British DL left-window envelope, the window displays blank white paper or marketing text, while the recipient address is trapped inside the opaque paper fold!LetterAPI eliminates this hazard. Our automated pre-flight intake engine automatically inspects the geometry of incoming documents. If our optical analyzer detects that the address block is positioned in a right-window or US-standard configuration, our API returns an immediate validation warning before printing, preventing costly misprints.Typography and formatting guidelines for optical character recognition (OCR)
Positioning the address block inside the window aperture is only half the battle; the typography itself must be optimized for Royal Mail's optical character recognition (OCR) scanning engines.To guarantee a 99.9% first-pass machine reading rate, developers must follow these typographic best practices:Font Family: Always use clean, unembellished sans-serif typefaces. Helvetica, Arial, Roboto, and Trebuchet MS achieve the highest machine reading accuracy. Never use decorative, script, cursive, or serif fonts (like Times New Roman or Georgia) in the address block.Font Size: Set the address block text between 10pt and 12pt (13px to 16px). Text smaller than 9pt is difficult for optical scanners to resolve at high speeds, while text larger than 14pt can cause address lines to overflow the bounding box.Font Color and Contrast: Text must be solid, high-contrast monochrome black (`#000000` or `#0f172a`). Never use grey, colored, or shaded fonts in the address block.Line Spacing: Maintain clean, consistent line height between 1.2 and 1.35. Avoid excessive vertical gaps between address lines.Punctuation and Alignment: Royal Mail guidelines recommend left-aligned text with no trailing punctuation (commas or periods at the end of address lines). The UK postcode must appear on the final line in uppercase characters (e.g. `SW1A 1AA`), separated from the city line.Technical blueprint: Pixel-perfect CSS print template for DL window envelopes
Here is the definitive, production-tested HTML and CSS print template that guarantees 100% compliance with Royal Mail DL left-window envelopes:templates/royal-mail-dl-letter.html — html<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"/><title>Royal Mail Compliant DL Letter</title><style>/* 1. Reset and Paper Setup */@page {size: A4 portrait;margin: 0;}* {box-sizing: border-box;-webkit-print-color-adjust: exact;}body {margin: 0;padding: 0;width: 210mm;height: 297mm;font-family: 'Helvetica Neue', Arial, sans-serif;color: #0f172a;background: #ffffff;font-size: 10.5pt;line-height: 1.5;}/* 2. STRICT ROYAL MAIL DL LEFT-WINDOW GEOMETRY */.royal-mail-dl-window {position: absolute;left: 20mm; /* Exactly 20mm from left edge */top: 40mm; /* Exactly 40mm from top edge */width: 90mm; /* Standard window width */height: 45mm; /* Standard window height */padding: 5mm; /* 5mm quiet zone on all sides */font-size: 11pt;line-height: 1.3;color: #000000;overflow: hidden;/* Optional debugging border (remove in production):border: 1px dashed #cbd5e1; */}/* 3. Header and Branding (Above and Right of Address Window) */.letter-header {position: absolute;top: 15mm;left: 20mm;right: 20mm;display: flex;justify-content: space-between;align-items: center;border-bottom: 1.5pt solid #0284c7;padding-bottom: 4mm;}.company-logo {font-size: 16pt;font-weight: 800;color: #0284c7;letter-spacing: -0.5px;}.metadata-block {position: absolute;top: 40mm;right: 20mm;width: 65mm;background: #f8fafc;border: 1px solid #e2e8f0;padding: 4mm;border-radius: 2mm;font-size: 9pt;}/* 4. Letter Body (Begins below the 1/3 fold line at 99mm) */.letter-body {position: absolute;top: 98mm; /* Clears the top fold zone */left: 20mm;right: 20mm;bottom: 25mm;}.letter-body h1 {font-size: 14pt;font-weight: bold;margin-top: 0;margin-bottom: 16px;color: #0f172a;}.letter-body p {margin-top: 0;margin-bottom: 12px;}/* 5. Footer (Statutory and Registered Company Information) */.letter-footer {position: absolute;bottom: 12mm;left: 20mm;right: 20mm;font-size: 8pt;color: #64748b;text-align: center;border-top: 0.5pt solid #e2e8f0;padding-top: 2mm;}</style></head><body><!-- HEADER --><div class="letter-header"><div class="company-logo">APEX CLOUD SYSTEMS</div><div style="font-size: 9pt; color: #64748b;">Statutory Notice</div></div><!-- RECIPIENT ADDRESS (VISIBLE THROUGH DL WINDOW) --><div class="royal-mail-dl-window"><strong>Eleanor Vance</strong><br/>Managing Director<br/>Kensington Technology Partners<br/>88 High Street Kensington<br/>London<br/><strong>W8 4SG</strong></div><!-- METADATA BOX (OPPOSITE THE WINDOW) --><div class="metadata-block"><div><strong>Account Ref:</strong> KTP-84920</div><div><strong>Notice Date:</strong> 17 September 2026</div><div><strong>Dispatch ID:</strong> LTR-99281-UK</div></div><!-- BODY CONTENT --><div class="letter-body"><h1>Formal Verification of Registered Service Address</h1><p>Dear Ms. Vance,</p><p>We are writing to confirm that the official correspondence address for Kensington Technology Partners has been updated in our enterprise platform database pursuant to your recent director resolution.</p><p>Under United Kingdom statutory compliance standards, formal notices concerning your enterprise cloud infrastructure will be dispatched to this verified address.</p><p>If this update was made in error or requires revision, please notify our compliance officer immediately through your secure online management console.</p><p>Sincerely,<br/><strong>The Operations Directorate</strong><br/>Apex Cloud Systems UK Ltd</p></div><!-- FOOTER --><div class="letter-footer">Apex Cloud Systems UK Ltd • Registered in England & Wales #10928374 • Registered Office: 100 Bishopsgate, London EC2N 4AG</div></body></html>
Automated validation in the LetterAPI intake pipeline
Even with clear CSS guidelines, human developers occasionally introduce small margin tweaks that unintentionally break envelope alignment.To protect our users from costly delivery failures, LetterAPI includes an automated Computer Vision pre-flight check in our API intake pipeline.When your application submits a PDF or HTML document, our rendering engine performs an automated spatial analysis:1. Window Aperture Bounding Box Check: The engine tests whether non-address text, high-saturation color blocks, or dark logos intrude into the 90mm x 45mm window zone.2. Address Text OCR Verification: The engine extracts the text within the window coordinate zone and verifies that it contains a valid recipient name, street thoroughfare, and UK postcode matching our PAF database.3. Postcode Validation: The extracted postcode is matched against Royal Mail's master Postcode Address File. If the postcode does not match the thoroughfare or city, an immediate API validation warning is generated.If the document violates Royal Mail spatial standards, LetterAPI rejects the submission with a clear, descriptive HTTP 422 Unprocessable Entity error, pinpointing the exact millimeter coordinates of the violation before a single penny of postage is incurred.The failure stakes: What happens when address geometry is ignored
What are the commercial consequences of neglecting envelope window positioning?When an unaligned mailing run is submitted to Royal Mail, sorting machines fail to read the addresses. Thousands of letters are shunted to manual sorting, adding 3 to 7 days of delivery delay.If the address block is partially covered by the envelope fold, the letters are deemed undeliverable. Royal Mail returns them in bulky plastic sacks to your office weeks later, long after statutory deadlines have expired.Your legal team faces dismissed court actions because proof of service cannot be demonstrated. Your finance team suffers cash flow delays because overdue notices never reached debtor desks. And your business wastes thousands of pounds on printing, envelopes, and postage that generated zero commercial result.The success transformation: 100% first-pass optical sorting compliance
Now envision your document generation pipeline powered by LetterAPI's calibrated geometry standards.Every invoice, tenancy notice, and compliance letter emerges from our industrial presses with mathematically perfect DL window alignment. Optical sorting machines process your letters at maximum speed with zero manual sorting delays.Deliveries land reliably on customer desks within 24 hours for First Class or 48 hours for Second Class, accompanied by real-time Mailmark delivery scans in your dashboard.Your developers ship document templates with complete confidence, knowing that LetterAPI's automated pre-flight checks protect your organization from layout regressions and delivery failures.Master the physical medium. Build pixel-perfect, Royal Mail-compliant letters with LetterAPI today.C5 envelope geometry: Designing multi-page bundles and formal legal packets
While DL envelopes are the gold standard for 1 to 3 page letters, many enterprise workflows require multi-page documents: complete tenancy agreements, detailed service charge accounts, mortgage offers, and court bundles.For documents exceeding 4 sheets of paper (or 8 pages duplexed), folding into thirds causes mechanical jams inside DL inserting machines. For these thicker mailings, developers must format documents for C5 window envelopes (162mm x 229mm).In a C5 mailing, an A4 sheet is folded in half once horizontally (a 'half fold' along the 148.5mm center line).The address window coordinates for a standard UK C5 window envelope differ slightly from DL:Left Margin Offset: Exactly 20mm in from the left edge.Top Margin Offset: Exactly 45mm down from the top edge.Window Aperture: 90mm wide by 45mm tall.Because C5 letters accommodate up to 35 sheets of 90gsm paper, LetterAPI's automated insertion machinery dynamically routes jobs based on page count: documents up to 4 sheets are folded into DL envelopes, while documents containing 5 to 35 sheets are automatically routed to C5 packaging lines, ensuring pristine presentation without paper jams.Address validation deep dive: How Royal Mail PAF matching prevents delivery exceptions
A common misconception among software engineers is that a UK postcode uniquely identifies a single building.In reality, a UK postcode (such as `EC2N 4AG`) represents an entire geographic delivery sector comprising an average of 15 to 20 distinct business premises or residential properties.To successfully deliver a letter, the address block must include both the postcode and an unambiguous premise identifier (e.g. '100 Bishopsgate, Floor 14').LetterAPI's intake pipeline integrates directly with Royal Mail's master Postcode Address File (PAF). When your application submits an address, our engine parses the premise and thoroughfare, matches it against PAF delivery points, and returns an automated match quality score.If an address has a minor typo (such as a misspelled street name), our engine standardizes it automatically. If a premise number is missing, our API flags the validation exception immediately, allowing your frontend UI to prompt the user for their apartment or suite number before printing.Troubleshooting window bleeding: Margin collapse, print scaling, and DPI distortion
When debugging address window alignment issues in local testing, developers frequently encounter three common CSS and rendering bugs:1. CSS Margin Collapse: If your body tag or address container uses unconstrained vertical margins, standard CSS margin collapse can push the address container down by an extra 10mm, moving text out of the window aperture. Always use `position: absolute;` with explicit millimeter offsets (`top: 40mm; left: 20mm;`) to guarantee fixed spatial placement.2. Print Scaling Distortion: If a developer views a PDF in a browser and clicks 'Print', many desktop PDF viewers default to 'Fit to Printable Area' or 'Scale: 95%'. This shrinks the entire A4 sheet, pulling the address block inward and misaligning the window! LetterAPI's industrial production presses always print at exact 100% 1:1 physical scale.3. Pixel-to-Millimeter Rounding Errors: Defining print layouts using pixel units (`px`) introduces rounding errors depending on browser DPI settings. An A4 sheet is exactly 210mm wide. Always define print CSS rules using physical millimeter units (`mm`) or points (`pt`), ensuring mathematically perfect dimensions across all rendering engines.The mechanical folding tolerance: Why the 5mm quiet zone is mathematically essential
Software engineers often ask why Royal Mail insists on a strict 5mm clear margin inside the window aperture.The answer lies in mechanical insertion physics. High-speed envelope folding and inserting machines process thousands of envelopes per hour using high-velocity vacuum grippers and mechanical belts.During physical transit through the folding chute, paper sheets exhibit a natural physical variance of plus or minus 1.5 millimeters. Furthermore, inside the envelope pocket, the paper sheet has approximately 2 millimeters of lateral movement.If text is printed flush against the window edge without a quiet zone, normal mechanical movement will cause the first letters of the address or postcode to slip behind the opaque paper envelope border, rendering the address unreadable to optical sorting cameras.By enforcing a strict 5mm quiet zone around the address block, developers provide the necessary mechanical tolerance buffer, guaranteeing that even with natural mechanical shifting, 100% of the address text remains perfectly centered within the clear aperture.LetterAPIPrint and post letters in the UK, from one letter to thousands.
© 2026 LetterAPI. All rights reserved.