Pular para o conteúdo

Ordenar linhas

Ordene qualquer lista: A-Z, Z-A, por comprimento ou aleatoriamente - no seu navegador.

Roda no seu navegador

Cole uma lista, escolha uma ordem, obtenha a saída ordenada. Cinco ordens: alfabética A-Z, Z-A, por comprimento (curto primeiro), por comprimento (longo primeiro), aleatório.

Como usar

  1. Paste your text

    One entry per line. Empty lines are kept or dropped per the option.

  2. Pick a sort order

    A-Z, Z-A, by length (short or long), or random.

  3. Copy the sorted list

    Output appears in the right pane. Hit Copy to grab it all.

O que é?

A line sorter takes a text input and re-orders its lines by a chosen comparison: lexicographic, length, or random. The interesting choices are around stability (lines with equal keys keep their input order), locale (so 'café' sorts properly), and natural ordering (so 'page-2' beats 'page-10').

Quando usar

Organising a list of names, emails, slugs or URLs before sharing or importing. Building an A-Z reference page from a notes dump. Shuffling a playlist or class roster when you need a random order. Putting a CSV's header line aside, then sorting the body, then pasting them back together.

Erros comuns

Sorting a CSV with a header row included - the header lands somewhere alphabetical and the file no longer parses. Forgetting that 'page-10' beats 'page-2' in pure-ASCII sort but not in natural sort. And using ascending order to mean 'oldest first' when the lines are dates in YYYY-MM-DD - that's already alphabetical-by-date, so ascending is oldest, descending is newest.

FAQ

Is the sort stable?
Yes. Lines that compare equal keep their relative input order. Important when you're sorting by length and want the original sequence preserved within each length bucket.
Does it handle numbers naturally?
Yes. 'item-2' sorts before 'item-10' using JavaScript's Intl-aware comparison; if you want pure ASCII order ('item-10' first), turn off natural ordering.
What about case?
Case-insensitive by default. Toggle case-sensitive to put all uppercase before lowercase ('A' before 'a').

Mais nesta categoria