---
title: "Sort lines of text"
method: POST
path: "/sort-lines.php"
tags: ["text"]
---

# Sort lines of text

`POST /sort-lines.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/sort-lines.php`
- Auth: none declared

Sorts lines: `order=asc|desc`. Optional case-insensitive comparison, locale-aware collation, natural-sort (where line2 sorts before line10), dedupe, line trimming and empty-line stripping.

## Request body

- object
  - `text` string, required
  - `order` 'asc' | 'desc'
  - `case_sensitive` boolean
  - `natural` boolean
  - `locale` string
  - `dedupe` boolean
  - `trim_lines` boolean
  - `drop_empty` boolean

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `413`: Request body or text exceeds 1 MB
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
