ASCII vs binary STL: how to tell them apart and convert
Open the STL in a text editor: readable lines that start with solid, facet normal and vertex mean ASCII, unreadable characters mean binary. Both describe the same triangles; binary is several times smaller.
An ASCII STL is plain text you can read; a binary STL stores the same triangles as packed numbers and is several times smaller. To tell them apart, open the file in a text editor, or compare its size with its triangle count. To convert, open it in the STL converter, choose STL (.stl) as the output format, tick or untick ASCII STL (bigger, human-readable) and press Download. STL to STL is free and unlimited there, and the file is not uploaded.
What you need
- The STL file and any text editor (Notepad, TextEdit, VS Code).
- A browser for the conversion. Files up to 100 MB are free.
How to tell ASCII from binary
- Text editor test. Open the file as text. ASCII shows lines such as
solid name,facet normal 0 0 1,outer loopandvertex 0 0 10. Binary shows unreadable characters. For a large file, print only the start instead:head -c 300 model.stlon macOS or Linux. - Size test. A binary STL is exactly 84 bytes plus 50 bytes per triangle. Open the file in the STL viewer and read Triangles and File size. Our sample knot has 7,680 triangles: 7,680 × 50 + 84 = 384,084 bytes, which is its exact size, so it is binary. A file several times larger than that sum is ASCII.
- Do not rely on the first word. ASCII starts with
solid, but the 80-byte header of a binary file is free text and may begin with the same word.
The viewer's panel lists the format as STL and does not name the encoding, so use one of the tests above.
What differs
| ASCII STL | Binary STL | |
|---|---|---|
| Contents | Text lines: solid, facet normal, outer loop, three vertex lines, endloop, endfacet, endsolid | 80-byte header, 4-byte triangle count, then 50 bytes per triangle |
| Numbers | Decimal text, as many digits as the exporter writes | 32-bit floats: twelve per triangle plus a 2-byte attribute |
| Size, 7,680 triangles | 2,356,527 bytes from our converter | 384,084 bytes |
| Size, 1,000,000 triangles | About 307 MB at the same rate | 50,000,084 bytes |
| Name of the solid | Optional, after the word solid | Only as a comment in the header |
| Units, colour | None | None in the original specification |
The layouts are those documented by the Library of Congress, which also notes that most STL in use is binary because ASCII files become unmanageably large. How much larger depends on the digits written: our converter writes full-length numbers, about 307 bytes per triangle, 6.1 times the binary size. A hand-written file with short numbers can be under twice the size.
Convert ASCII to binary, or binary to ASCII
- Open the STL converter and drop the file. Both encodings open the same way.
- Under Convert & download, set Output format to STL (.stl). The list starts on OBJ for an STL input.
- A checkbox appears: ASCII STL (bigger, human-readable). Leave it unticked for binary, tick it for ASCII.
- Keep Scale on "Keep size (×1)" and press Download. The status line confirms with the new size, for example "Done – knot.stl (2.2 MB)".
- The download has the same file name as the original. Rename it, or save it in another folder, so you know which is which.
Which of our tools writes which
| Tool | STL it writes | ASCII option |
|---|---|---|
| STL converter, STL viewer and the other viewer and converter pages | Binary by default | Yes, the checkbox |
| Batch converter | Binary | No |
| Generators and mesh tools (repair, cut, scale, mold, terrain, relief and the rest) | Binary | No |
All of them read both encodings. To get ASCII out of a generator, download its STL and pass it through the converter.
What the conversion changes
- Triangles: none are added or removed. The count stays the same.
- Precision: binary holds 32-bit floats, about seven significant digits. At a coordinate of 100 mm the step between two values is about 0.000008 mm, far below anything a printer resolves. Writing ASCII from a binary file adds digits, not accuracy.
- Normals: they are recalculated from the corner points. A file with
facet normal 0 0 0comes out with real normals. - Name and header: the solid's name is not kept. Our ASCII output starts with
solid exported; our binary header is 80 zero bytes.
Does it matter for printing?
Not for the result. The slicer reads the same triangles either way; PrusaSlicer 2.9.7 loaded our ASCII and binary test files with identical triangle counts. It matters for handling: an ASCII file takes several times the disk space and the transfer time. Use binary unless a program or script tells you it needs ASCII, or you want to read or compare the file as text. If the file is still too big as binary, the triangle count is the problem: see how to reduce STL file size and STL size limits in slicers.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| A program rejects the file or shows garbage | It trusts the first word: a binary header starting with solid is read as text | Convert to binary here; our header does not contain the word |
| "This STL is cut off…" | The header promises more triangles than the file holds: an interrupted download or export | Download or export it again; the part that arrived is shown |
| "This is not a valid STL file…" | Another kind of file with the .stl extension | Check where it came from; see how to open an STL file |
| The ASCII file is huge | Text needs many characters per number | Convert to binary, or ZIP it for sending |
| The model is 25.4 or 1,000 times too small | Neither encoding stores units | See STL units and scale |
What the tool cannot do
- Choose the number of decimals in ASCII output, or keep the original solid name.
- Write ASCII in batch. The batch converter writes binary only.
- Add colour or units. STL has no place for them. Use 3MF: STL vs 3MF explains the difference.
- Label the encoding of the file you opened. Use the text or size test.
FAQ
How do I know if my STL is ASCII or binary?
Open it in a text editor. Readable lines with solid, facet normal and vertex mean ASCII; unreadable characters mean binary. Or check the size: a binary STL is exactly 84 bytes plus 50 bytes per triangle.
Is binary STL less accurate than ASCII?
Not in any way a printer can show. Binary stores 32-bit floats, about seven significant digits, which is around 0.000008 mm at a coordinate of 100 mm.
How much smaller is a binary STL?
Binary is always 50 bytes per triangle. ASCII depends on how many digits are written: our converter produces about 307 bytes per triangle, 6.1 times larger; files with short numbers are closer to twice the size.
Which one should I use for 3D printing?
Binary. Slicers read both and the print is the same, but binary files are smaller and load faster. Use ASCII only when a program asks for it or you need to read the file as text.