PES File Documentation


Summary

A PES file is a Brother embroidery design, the native format of Brother's PE-Design software used across Brother, Baby Lock and Bernina machines. It is a binary file that stores stitch coordinates, thread colours and machine commands (stop, jump, trim) — the needle path a machine sews, not a normal picture. It begins with the ASCII tag #PES and a version number, and wraps a PEC stitch block plus an embedded preview. Free tools like Wilcom TrueSizer or Ink/Stitch open it.

Technical details

FeatureValue
Full nameBrother/Baby Lock PES Embroidery File
File extension.pes
MIME typeapplication/octet-stream
Format typeBinary machine-embroidery design (stitch data + colours + preview)
DeveloperBrother Industries (PE-Design)
Used byBrother, Baby Lock, and older Bernina embroidery machines
Introduced1990s (Brother PE-Design); versions v1–v11
Open standardNo — proprietary, undocumented by vendor
Byte orderLittle-endian
Magic number (hex)23 50 45 53 (ASCII #PES)
Version tag4-char code after #PES, e.g. 0001, 0040, 0060, 0100
Embedded blockPEC stitch block (tagged #PEC) + colour list + thumbnail
Stitch coordinate unit0.1 mm per unit (signed values)
Colour modelOrdered thread list, mapped to a brand thread chart
Related extensions.pec, .dst, .exp, .vp3, .jef, .hus, .vip
File signature (magic bytes)
23 50 45 53 30 30 __ __

Offset 0, 8 bytes. In ASCII this reads #PES followed by a 4-character version code such as 0001, 0040, 0060 or 0100 (PES v1 … v10/v11). Bytes 0–3 are the literal tag #PES (23 50 45 53); bytes 4–7 are the version digits. A 32-bit offset near the start of the header points to the embedded PEC stitch block, which is tagged #PEC and holds the actual stitch commands. The version code matters: an older machine may reject a newer PES version, a common "won't read" cause.

What is a PES file?

PES is the native machine-embroidery format of Brother's PE-Design software, used across the Brother, Baby Lock and (on older models) Bernina family of embroidery machines. It first appeared in the 1990s. A PES file is not a picture in any normal sense: it is closer to a Computer-Aided Manufacturing program for a needle. Rather than storing pixels, it stores the precise path the needle travels — a sequence of stitch coordinates — together with the machine commands that punctuate that path (stop, jump, trim, colour change) and a palette that says which thread to load for each section. The machine "runs" the file to sew the design.

Structurally, PES is a binary wrapper around a lower-level stitch block. The PES layer carries design-level metadata and colour information; embedded inside it is a PEC block that holds the actual low-level stitch commands, along with an embedded thumbnail preview. That two-layer arrangement, the way stitches are encoded byte by byte, and the versioning that decides whether your machine will read the file are the subjects of this article.

The #PES header and version code

Every PES file starts with an 8-byte header at offset 0: the four ASCII bytes #PES (23 50 45 53) followed by a four-character version code.

Offset 0:  23 50 45 53  30 30 30 31   "#PES" + "0001"   (version tag)
Offset 8:  ... a 32-bit little-endian offset to the embedded PEC block ...
           ... CEmbOne / CSewSeg section: design extents, hoop, segments ...
           #PEC block: colour count, stitch list, thumbnail(s)

The version code is the digits that follow the tag — 0001, 0020, 0030, 0040, 0050, 0055, 0060, up to 0100 for the newest revisions. It advances as PE-Design gains features. This single field is the most common reason a design "won't load": an older machine's firmware only understands PES versions up to a certain point, so a file saved as a newer version is rejected. The fix is to open the design in embroidery software and save it down to an older PES version. Just past the header, a 32-bit little-endian offset points forward to where the embedded PEC block begins, so a reader can jump straight to the stitch data.

The two layers: PES wrapper and PEC block

PES is best understood as two formats nested together. The outer PES layer (the CEmbOne / CSewSeg sections) holds design-level structure: the overall extents, hoop information, and a description of the design's segments as PE-Design authored them, which is what lets the design be re-edited in Brother software. The inner PEC block holds the machine-ready payload: the ordered thread colour list, the raw stitch commands the machine executes, and one or more embedded bitmap thumbnails.

This is why .pec also exists as a standalone extension — it is the same stitch block that lives inside every PES, sometimes stored on its own. When embroidery software "converts PES to PEC", it is largely extracting the block that was already embedded, not translating between unrelated formats. The split also explains a practical fact: the PEC block is what the machine actually needs to sew, while the surrounding PES data is what design software needs to edit; a viewer that only reads the PEC can still show and stitch the design but cannot recover the full editing structure.

Stitch encoding: relative moves in tenths of a millimetre

Stitches in the PEC block are stored as relative moves: each stitch records a change in position (dx, dy) from the previous needle point, not an absolute coordinate. Each unit is 0.1 mm, so a small design fits in small numbers and the whole path is a running sum of deltas. Normal stitches encode dx and dy in a compact one-byte-each form when the move is small.

Normal stitch : two signed bytes, dx then dy, each in 0.1 mm units
Long move     : if the high bit (0x80) of a value is set, it becomes a
                12-bit value: the low 4 bits are combined with the next
                byte (low 4 bits * 256 + next byte) for a larger dx/dy
Jump stitch   : bit 5 (0x10 region) flags a jump — the needle moves
                without stitching (travel between design areas)
Colour change : the bytes 0xFE 0xB0 introduce a colour change, followed
                by an index into the thread list
End of stitches: a terminating marker closes the stitch list

The encoding is deliberately compact because a real design can hold tens of thousands of stitches, and most moves are tiny. A jump is a move with no stitch formed, used to travel across the fabric from one filled area to another; the machine may trim the thread across a long jump. A colour change pauses the machine so the operator can rethread, and its index selects the next entry from the colour list. The two-byte extension mechanism (triggered by the high bit) is what lets an occasional long move exceed the range of a single signed byte without making every stitch larger.

The colour list and thread mapping

PES does not store colours as free RGB values a designer picked; it stores an ordered list of thread references, typically indices into a manufacturer's thread chart (Brother, Madeira, and others). Each entry corresponds to one continuous run of stitching between colour changes, in sewing order. This is a meaningful difference from image formats: the "colour" of a section is really "load thread number N from this chart", so the on-screen preview depends on the software's copy of that chart to show the right shade. It is also why converting a PES to DST loses colour: DST has no native colour model at all, so the thread assignments are dropped and must be re-entered on the machine or in software.

The embedded thumbnail: one bit per pixel

The PEC block carries one or more embedded bitmap thumbnails so software (and the machine's screen) can preview the design without rendering every stitch. These are monochrome images stored one bit per pixel: within each byte, eight horizontal pixels are packed, most-significant bit first, and a "width in bytes" value gives the row length (a width of 6 means 6 × 8 = 48 pixels per line). There is a main thumbnail for the whole design plus, usually, one per thread colour, so a viewer can show each colour block in isolation. The size of each thumbnail is simply width-in-bytes × height. Because it is one-bit, the thumbnail is a line-art silhouette of the stitching, not a coloured render — the colour comes from the thread list, applied by the previewing software.

Why so many embroidery formats exist

PES is one dialect in a fragmented world. Almost every embroidery-machine brand defined its own stitch format: Tajima DST, Melco EXP, Husqvarna/Viking HUS and VP3, Janome JEF, Pfaff and Brother PCS. They all encode roughly the same thing — relative stitch moves plus machine commands — but with incompatible byte layouts and different (or absent) colour handling. PES is simply the Brother dialect. The practical consequence is that the recurring task with these files is conversion: PES to DST is the most common, because DST is the nearest thing to a universal interchange format accepted by most multi-brand and commercial machines, at the cost of dropping the colour information PES carries.

One conversion does not exist in the way people expect. You cannot turn a JPG or PNG photo into a real PES by "converting" it. Producing stitches from an image is digitizing: a skilled, largely manual process in software such as Ink/Stitch or Brother PE-Design, where a person decides stitch types, directions, densities and sewing order. Automatic photo-to-PES tools exist but generally produce poor stitch quality, because the machine needs a deliberate needle path, not a pixel grid.

References