ForHosting KIT · Text & AI

Swap case converter

Flip every letter's case in one pass: tHIS IS WRONG, typed with Caps Lock on, becomes This is wrong, and Hello World becomes hELLO wORLD. Digits, spaces and punctuation stay exactly where they are. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello World
You get
Text
hELLO wORLD
Original
Hello World
Length
11

This swap-case converter takes any non-empty text string and returns the same characters with every letter flipped between upper and lower case. When Caps Lock was on by mistake, Hello becomes hELLO and a whole sentence can be repaired in one pass without retyping. The engine is fully deterministic: it walks each character, maps letters that have distinct upper and lower forms to the opposite form, never calls the network, never samples randomness, and never depends on the clock. Digits, spaces, and punctuation stay exactly where you put them; only letter case changes.

Swap case means every letter that has a capital and a small form is inverted: uppercase becomes lowercase and lowercase becomes uppercase, while non-letters stay unchanged. In practice Hello World becomes hELLO wORLD, a caps-lock mess like tHIS IS WRONG becomes This is wrong when the original intent was normal sentence case, and accented words such as Café become cAFÉ when the runtime case map defines that pairing.

The transform is not title case, sentence case, alternating case, or all-caps: it does not invent word boundaries or force a single case for the whole string. There is no partial mode that flips only the first letter, no locale override switch in this capacity, and no silent coercion of null into an empty string.

Where swap case fits in study, publishing, and software

Students meet swap case when a coding exercise asks for inverted letter case, when a data-entry lab recovers text typed with Caps Lock stuck on, or when a style sheet demo shows how case maps work character by character. Teachers can pre-generate answer keys that show the expected flipped form without trusting opaque office macros that change locale rules mid-file. Designers and producers use it to reverse accidental all-caps drafts back toward mixed case, to prepare playful display text, and to stress-test fonts that render upper and lower glyphs differently.

Support and operations teams paste noisy ticket subjects into the tool to restore readable case when someone typed with the lock key on. Pair it with uppercase, lowercase, or alternating-case tools when you are building a small lab of free, deterministic text helpers for forms, CMS prep, and data hygiene.

Fix caps-lock mistakes

Recover readable mixed case when a whole message was typed with Caps Lock on, without retyping the content.

Copy and data cleanup

Flip inverted draft text for emails, tickets, and CMS fields before publishing or filing.

What does the swap-case converter cost?

It is free in your browser on this page.

What happens if I send an empty string?

Empty text is not a valid conversion; provide at least one character.

Are digits and punctuation changed?

No. Only letters with distinct upper and lower forms are flipped. Digits, spaces, symbols, and punctuation stay in place and unchanged.

Is this the same as alternating case?

No. Alternating case forces a pattern like aLtErNaTiNg. Swap case only inverts each letter’s existing case, so Hello becomes hELLO.

Is the result the same every time for the same input?

Yes. The transform is pure and deterministic: no network, no randomness, and no clock. The same text always yields the same swap-cased string.

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/swap-case

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/swap-case \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello World"}'
{
  "text": "Hello World"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.swap_case",
  "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.

Empty input is rejected with a clear invalid_input error so a blank form field cannot become a silent empty success.

What swap case means and what the response contains

This calculator returns four stable fields: text holds the swap-cased result you will copy or store, original echoes the exact input string so you can audit what was transformed, length reports the character count of the result (which matches the original length for ordinary BMP text), and method is the fixed tag swap_case for logs and multi-tool pipelines. The engine either builds a complete swap-cased string inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, objects and arrays that are not plain text, and any payload longer than the documented maximum character count.

How the text field is read and how the result stays reproducible

The value must be a non-empty string; finite numbers and bigints are stringified first so a bare product code typed as a number still passes through cleanly after conversion to decimal digits, with no letter flips when the string has only digits. Conversion uses the JavaScript String toUpperCase and toLowerCase paths per character, which apply standard Unicode default case mappings available in the runtime—no network dictionary, no machine-learning model, and no date-dependent exceptions. The preferred field is text, but aliases input, string, value, content, and s are accepted so query strings, spreadsheets, and typed forms can reuse the same contract without renaming columns. Booleans, plain objects, and arrays are rejected with a clear message so a mistaken JSON body does not become the word TRUE or an unhelpful object dump. Empty string is always invalid_input: the product promise is convert text, not invent a blank success. Length is capped at one hundred thousand characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. Pair the free browser run on this page with the priced API when you need the identical swap-case result inside an automated pipeline without shipping your own string helpers.

Where swap case fits in study, publishing, and software

On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the string result.

Deterministic test fixtures

Generate reproducible swap-case strings for unit tests, golden files, and CI assertions on case-handling code.

Read the full KIT documentation →