CORE
Unit Converters
Convert between OOXML measurement units — TWIP, EMU, pixels, inches, points
OOXML uses multiple measurement systems. WordprocessingML uses TWIPs, DrawingML uses EMU (English Metric Units). These converters bridge the gap.
TWIP Conversions
TWIP = twentieth of a point. 1 inch = 1440 TWIPs.
import { convertMillimetersToTwip, convertInchesToTwip } from "@office-open/core";
convertMillimetersToTwip(25.4); // 1440 (1 inch)
convertInchesToTwip(1); // 1440
convertInchesToTwip(0.5); // 720
EMU Conversions
EMU = English Metric Unit. 1 inch = 914400 EMU. Used for images, shapes, and drawings.
Pixels ↔ EMU (96 DPI)
import { convertPixelsToEmu, convertEmuToPixels } from "@office-open/core";
convertPixelsToEmu(100); // 952500
convertEmuToPixels(952500); // 100
Inches ↔ EMU
import { convertInchesToEmu, convertEmuToInches } from "@office-open/core";
convertInchesToEmu(1); // 914400
convertEmuToInches(914400); // 1
Points ↔ EMU
import { convertPointsToEmu, convertEmuToPoints } from "@office-open/core";
convertPointsToEmu(12); // 152400
convertEmuToPoints(152400); // 12
Conversion Table
| From | To | Function | Formula |
|---|---|---|---|
| mm | TWIP | convertMillimetersToTwip | mm × 56.692913 |
| inches | TWIP | convertInchesToTwip | in × 1440 |
| pixels | EMU | convertPixelsToEmu | px × 9525 |
| EMU | pixels | convertEmuToPixels | emu ÷ 9525 |
| inches | EMU | convertInchesToEmu | in × 914400 |
| EMU | inches | convertEmuToInches | emu ÷ 914400 |
| points | EMU | convertPointsToEmu | pt × 12700 |
| EMU | points | convertEmuToPoints | emu ÷ 12700 |
Common Unit Reference
| Unit | Full Name | Used In | 1 inch equals |
|---|---|---|---|
| TWIP | Twentieth of a point | WordprocessingML | 1440 |
| EMU | English Metric Unit | DrawingML | 914400 |
| pt | Point | Typography | 72 |
| px | Pixel (96 DPI) | Screen layout | 96 |
| mm | Millimeter | Metric | 25.4 |