{
  "slug": "truncate-text",
  "name": "gizza-ai/truncate-text",
  "version": "0.1.0",
  "title": "Truncate Text — Shorten Text by Characters or Words — gizza.ai",
  "description": "Truncate text to a character or word limit with word-safe cutting and a custom ellipsis. Free, private, runs in your browser, no sign-up.",
  "tags": [
    "truncate text",
    "shorten text",
    "text ellipsis",
    "trim text to length",
    "limit characters",
    "limit words",
    "text snippet",
    "meta description length"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/truncate-text/",
    "markdown": "https://gizza.ai/tools/truncate-text/index.md",
    "descriptor": "https://gizza.ai/tools/truncate-text/tool.json",
    "deep_link_example": "https://gizza.ai/tools/truncate-text/?text=Paste%20the%20text%20you%20want%20to%20shorten%E2%80%A6&length=100&unit=characters&ellipsis=%E2%80%A6&count_ellipsis=true&break_words=true"
  },
  "cli": "gizza tool truncate-text \"Paste the text you want to shorten…\"",
  "tool": {
    "description": "Shorten text to a maximum number of characters or words, appending an ellipsis only when the text is actually cut (text that already fits is returned unchanged). Set length (default 100) to the limit and unit to \"characters\" (default) or \"words\". For character truncation, break_words=false (default) backs the cut up to the last whitespace so a word is never split, and count_ellipsis=true (default) keeps the whole result — ellipsis included — within length. ellipsis is the marker appended when cut (default \"…\"; set empty for a hard cut). Useful for building previews, snippets, meta descriptions, table cells, or summaries of a fixed length.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "break_words": {
          "default": false,
          "description": "When false (default), the cut is backed up to the last whitespace so a word is never split mid-way. When true, the text is cut exactly at the character limit. Ignored when unit is words.",
          "type": "boolean"
        },
        "count_ellipsis": {
          "default": true,
          "description": "When true (default), the ellipsis length counts toward the character budget so the whole result fits within `length`. Ignored when unit is words.",
          "type": "boolean"
        },
        "ellipsis": {
          "default": "…",
          "description": "Marker appended when text is actually cut (default \"…\"). Set to an empty string for a hard cut with no marker.",
          "type": "string"
        },
        "length": {
          "default": 100,
          "description": "Maximum number of units to keep (default 100), measured per `unit`.",
          "maximum": 1000000,
          "minimum": 1,
          "type": "integer"
        },
        "text": {
          "description": "The text to shorten. Returned unchanged (no ellipsis) when it already fits within the limit.",
          "type": "string"
        },
        "unit": {
          "default": "characters",
          "description": "Measure the limit in characters (default) or whole words.",
          "enum": [
            "characters",
            "words"
          ],
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  }
}