ForHosting KIT · Text & AI

Reverse paragraph order

An introduction, its supporting details and a conclusion come back as conclusion, details, introduction: 3 paragraphs in reverse order, each one untouched inside, wrapped lines included. Blank lines mark where one paragraph ends. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Reverse Paragraph Order rearranges a piece of plain text from its final paragraph back to its first without reversing words, sentences, or characters inside any paragraph. Paste text whose paragraphs are separated by blank lines, and the tool returns the same blocks in the opposite sequence with a consistent blank line between them. Internal line breaks remain attached to their paragraph, so wrapped quotations, addresses, lists, and other multiline blocks stay together. The operation is deterministic, local, and useful when an outline, draft, transcript, or exported set of notes arrived in exactly the wrong section order.

How paragraph order reversal works

The tool treats a paragraph as a non-empty block separated from another block by one or more blank lines. It first validates that text exists, is a string, contains a visible character, and stays within the published one hundred thousand character limit. Windows, Unix, and older carriage-return newlines are normalized so identical text behaves consistently across systems.

The parser then finds blank lines, including lines that contain only spaces or tabs, and uses them as paragraph boundaries. It does not split at an ordinary single newline. That distinction keeps a hard-wrapped sentence, a multiline quotation, or several lines belonging to one content block together.

After parsing, the array of complete paragraphs is copied and reversed. No paragraph is read backward, rewritten, summarized, or sorted alphabetically. Finally, the reversed blocks are joined with one empty line between adjacent paragraphs.

Leading and trailing whitespace outside the document is removed, while the content and internal line structure of each detected block remain unchanged. The response includes the reordered text, the number of paragraphs found, and the reversed paragraph array, giving both a ready-to-copy result and structured blocks for an automated workflow.

Where the reordered text goes next

For example, a three-part note with an introduction, supporting details, and a conclusion returns the conclusion first, the supporting details second, and the introduction last. Read the text field when you need a finished value that can be pasted into an editor, stored in a CMS, or passed to another text operation. Preserve blank lines in the submitted value because they define the boundaries.

If source data has collapsed all paragraphs into a single line, the capability correctly sees one block and has nothing meaningful to reorder. If every physical line should be treated as its own unit, insert blank lines between those lines first or choose a line-order tool.

Practical choices, edge cases, and limitations

Use paragraph reversal when the blocks are already correct but their sequence is backward. Common examples include notes exported newest-first, interview answers collected from the bottom of a form upward, sections copied from a reversed outline, and content blocks that need a quick last-to-first review. Check the paragraphs array if spacing in the source is unusual; multiple blank lines collapse into a single boundary in the output, but they never create empty blocks.

Spaces or tabs on an otherwise blank line also count as a separator. Single newlines stay within a paragraph, making the tool suitable for wrapped prose and multiline fragments, yet that rule means a list with no blank lines is treated as one paragraph. The capability deliberately does not understand HTML elements, Markdown syntax, headings, page breaks, semantic topics, or sentence structure.

It operates on plain-text blank-line boundaries only. Strip markup first when element boundaries rather than blank lines should control the order. It also removes whitespace around the complete document and emits normalized LF newlines, so it is not intended for byte-for-byte preservation of platform-specific line endings or decorative outer spacing.

Within each detected paragraph, words and sentences retain their original order. Review the result before publication whenever references such as “above,” “below,” “first,” or “finally” depend on the old sequence, because structural reversal cannot rewrite those contextual phrases.

Reorder reverse-chronological notes

Turn a newest-first export into oldest-first reading order while keeping every note block unchanged.

Repair a backward draft outline

Flip sections copied in reverse sequence without disturbing sentences, quotations, or internal line breaks.

Prepare structured content pipelines

Return both joined text and a reversed paragraph array for CMS imports, scripts, tests, and editorial automation.

Does this reverse the words inside each paragraph?

No. It reverses only the order of paragraph blocks. Words, sentences, and single line breaks inside each paragraph keep their original order.

How are paragraphs detected?

One or more blank lines separate paragraphs. A line containing only spaces or tabs is blank, while a single newline remains inside the same paragraph.

Are repeated blank lines preserved?

No. Repeated blank lines define one boundary, and output uses one empty line between reversed paragraphs. Content inside each paragraph remains intact.

Why did nothing change after I reversed my text?

Most likely there are no blank lines between your paragraphs, so the whole text is read as one block. Add an empty line between each paragraph and run it again, and the blocks will swap places.

How do I reverse every line instead of every paragraph?

A single line break never splits a paragraph here, so lines inside a block stay together. To flip line by line, insert a blank line between the lines first, or use a tool that reverses line order.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/reverse-paragraphs

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/reverse-paragraphs \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Introduction comes first.\n\nSupporting details come second.\n\nConclusion comes last."}'
{
  "text": "Introduction comes first.\n\nSupporting details come second.\n\nConclusion comes last."
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.reverse_paragraphs",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Using the result in an API or browser workflow

Send one JSON field named text containing the complete plain-text document. Read paragraphs when your application needs each reversed block separately, and use paragraph_count to confirm how many blocks were detected. A successful API request costs $0.002; invalid input is reported as invalid_input instead of producing a misleading empty result. The function uses no network service, language model, random source, or clock, so repeated calls with the same input return exactly the same JSON.

What happens when the text has only one paragraph?

The successful result contains the same paragraph, a paragraph_count of one, and a one-item paragraphs array.

How much does the API request cost?

A successful API request costs $0.002. The browser tool runs the same deterministic logic, and invalid input returns invalid_input.

Read the full KIT documentation →