{
  "slug": "stl-format-converter",
  "name": "gizza-ai/stl-format-converter",
  "version": "0.1.0",
  "title": "STL Format Converter — Binary to ASCII STL and Back — gizza.ai",
  "description": "Convert an STL between binary and ASCII either way, in your browser. Paste binary STL bytes as base64 or hex for readable text, or ASCII STL for a binary download.",
  "tags": [
    "stl format converter",
    "binary stl to ascii",
    "ascii stl to binary",
    "stl converter",
    "stl binary to text",
    "convert stl encoding",
    "stl to ascii online",
    "binary stl reader",
    "stl file converter"
  ],
  "category": "image",
  "urls": {
    "page": "https://gizza.ai/tools/stl-format-converter/",
    "markdown": "https://gizza.ai/tools/stl-format-converter/index.md",
    "descriptor": "https://gizza.ai/tools/stl-format-converter/tool.json",
    "deep_link_example": "https://gizza.ai/tools/stl-format-converter/?stl=solid%20demo%0A%20%20facet%20normal%200%200%201%0A%20%20%20%20outer%20loop%0A%20%20%20%20%20%20vertex%200%200%200%0A%20%20%20%20%20%20vertex%2010%200%200%0A%20%20%20%20%20%20vertex%200%2010%200%0A%20%20%20%20endloop%0A%20%20endfacet%0Aendsolid%20demo&input_format=auto&to=auto&output=stl&solid_name=bracket-v2&normals=keep&number_format=scientific&precision=6&output_encoding=data-url"
  },
  "cli": "gizza tool stl-format-converter \"solid demo\n  facet normal 0 0 1\n    outer loop\n      vertex 0 0 0\n      vertex 10 0 0\n      vertex 0 10 0\n    endloop\n  endfacet\nendsolid demo\"",
  "tool": {
    "description": "Convert an STL mesh between its binary and ASCII encodings, in either direction. Binary STL is not text, so paste its bytes as base64 or hex (a data:model/stl;base64 URL works too) and get readable ASCII STL back; paste ASCII STL text and get a compact binary STL back as a data:model/stl;base64 URL (or raw base64/hex via output_encoding). The input encoding is auto-detected by its 84 + 50 x triangle-count byte length rather than the leading 'solid' keyword, which binary headers also carry. to=auto (default) flips to the other encoding; set to=ascii or to=binary to force one, including re-writing a file in its own encoding to renormalise it. Geometry is carried as the 32-bit floats binary STL stores, so nothing is welded, repaired, scaled or re-ordered; normals=keep (default) copies stored facet normals through untouched, and number_format=scientific with precision=9 makes a binary -> ASCII -> binary round trip byte-identical. solid_name overwrites the ASCII solid name / binary 80-byte header (blank keeps the source's own), and output=summary returns a conversion report — encoding, triangle count, sizes and size change, and any per-triangle VisCAM/SolidView colour attribute bytes that ASCII STL cannot store. Up to 100000 triangles. Runs fully locally, no network access.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "input_format": {
          "default": "auto",
          "description": "How the pasted value is encoded. 'auto' (default) detects ASCII STL text, hex bytes or base64 bytes; binary STL is recognised by its 84 + 50 x triangle-count byte length rather than the leading 'solid' keyword, which many exporters also write into a binary header. Set 'ascii', 'base64' or 'hex' to force one.",
          "enum": [
            "auto",
            "ascii",
            "base64",
            "hex"
          ],
          "type": "string"
        },
        "normals": {
          "default": "keep",
          "description": "What to do with each facet's stored normal vector. 'keep' (default) copies it through untouched, so the conversion is lossless. 'recompute' derives it from the triangle's own winding by the right-hand rule, which fixes normals an exporter got wrong. 'zero' writes 0 0 0, the convention meaning 'no normal declared — use the vertex order'.",
          "enum": [
            "keep",
            "recompute",
            "zero"
          ],
          "type": "string"
        },
        "number_format": {
          "default": "scientific",
          "description": "How ASCII coordinates are written (ignored for binary output). 'scientific' (default) uses the STL specification's sign-mantissa-e-sign-exponent shape, e.g. 2.648000e-002, which is what CAD exporters write. 'decimal' writes plain numbers such as 0.002648 with trailing zeros trimmed — easier to read and diff, but it rounds values far from 1 to the chosen number of decimal places.",
          "enum": [
            "scientific",
            "decimal"
          ],
          "type": "string"
        },
        "output": {
          "default": "stl",
          "description": "What to return. 'stl' (default) is the converted mesh itself. 'summary' is a short conversion report instead: the detected input encoding, triangle count, solid name, input and output sizes with the size change, how normals were handled, and whether the file carried per-triangle attribute bytes (VisCAM/SolidView colour) that ASCII STL cannot store.",
          "enum": [
            "stl",
            "summary"
          ],
          "type": "string"
        },
        "output_encoding": {
          "default": "data-url",
          "description": "How binary STL output is handed back, since binary is not text (ignored for ASCII output). 'data-url' (default) returns a data:model/stl;base64,… URL you can save straight to a .stl file. 'base64' and 'hex' return the raw encoded bytes, which is what you want when piping the result into another tool.",
          "enum": [
            "data-url",
            "base64",
            "hex"
          ],
          "type": "string"
        },
        "precision": {
          "default": 6,
          "description": "Decimal places used for ASCII coordinates (default 6, matching common CAD exporters; ignored for binary output). STL coordinates are 32-bit floats, so precision 9 with number_format=scientific is the smallest setting that reproduces every value exactly — use it when you plan to convert back to binary and want a byte-identical file.",
          "maximum": 17,
          "minimum": 0,
          "type": "integer"
        },
        "solid_name": {
          "default": "",
          "description": "Name written into the output: the ASCII 'solid'/'endsolid' name, or the binary 80-byte header. Leave blank (default) to carry the source file's own name through unchanged. A binary STL must never start with the word 'solid', so a name beginning with it is written as 'STL <name>' in binary headers.",
          "type": "string"
        },
        "stl": {
          "description": "The STL mesh to re-encode. Paste an ASCII STL as text (solid / facet normal / outer loop / vertex lines), or a BINARY STL's bytes encoded as base64 or hex (hex may include spaces, colons or dashes; a data:model/stl;base64 URL is accepted too). Binary STL is not text, so it cannot be pasted directly. Up to 100000 triangles.",
          "type": "string"
        },
        "to": {
          "default": "auto",
          "description": "Which encoding to write. 'auto' (default) flips to the other one — binary in gives ASCII out, ASCII in gives binary out. 'ascii' always returns readable STL text; 'binary' always returns binary STL bytes (see output_encoding). Choosing the encoding the input already uses re-writes the file in place, which is how you renormalise the solid name, facet normals or number formatting.",
          "enum": [
            "auto",
            "ascii",
            "binary"
          ],
          "type": "string"
        }
      },
      "required": [
        "stl"
      ],
      "type": "object"
    }
  }
}