Text Transform
TextConvert text between naming conventions, letter cases, East-Asian widths, and reverse it.
On this page
What is a text transform tool?#
A text transform tool rewrites a string according to a fixed rule — change the case, switch the naming convention, flip half-width and full-width forms, or reverse the characters. Most of these jobs have a one-line answer in your head until you actually try to do them: “convert this header to kebab-case” is obvious for Content Type but ambiguous for HTTPServer, getUserById_v2, or X-Rate-Limit-Remaining. Which parts are words? Where do the boundaries fall?
This tool answers that with a single, predictable word-splitter. It normalises separators (underscore, dash, whitespace, punctuation), then inserts boundaries at camelCase and PascalCase joints, at acronym-to-word joints (HTTPServer → HTTP Server), and at letter-to-digit joints (v2 → v 2). The resulting tokens feed twelve operations: five naming conventions (camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE), four letter cases (UPPER, lower, Title, Sentence), East-Asian width conversion (half ↔ full), and reverse. Reverse walks by Unicode code point, so emoji and other surrogate-pair characters survive intact instead of turning into broken halves.
How to use it#
- Pick the operation from the dropdown in the toolbar. The twelve options are grouped logically: naming conventions first, then letter cases, then width conversion, then reverse.
- Type or paste into the input pane on the left, or hit Sample to load an example that exercises the splitter.
- Read the result in the output pane on the right — it updates the moment input or the selected operation changes.
- Click Copy in the output header to grab the transformed string, or Clear to start over.
The operations are total: empty input yields empty output, and no operation can throw. Switching the dropdown re-runs the same input through the new rule instantly, which makes this a fast way to compare, say, snake_case against kebab-case for the same identifier.
Key features#
- One splitter, twelve outputs. The same word boundaries feed every naming convention, so
getUserById_v2produces consistentgetUserByIdV2/GetUserByIdV2/get_user_by_id_v2/get-user-by-id-v2/GET_USER_BY_ID_V2. - Acronym-aware splitting.
HTTPServersplits intoHTTP+Server, notHTTPServer— the recognised pattern (a run of capitals followed by a capital-plus-lowercase word) keeps acronyms readable. - Letter-to-digit boundaries.
v2becomes two tokens, soversion2slugifies cleanly instead of gluing a digit onto a word. - East-Asian width conversion. Half-width ASCII
Hello 123becomes full-widthHello 123(space included), and the inverse restores ASCII — useful when filling East-Asian forms or aligning CJK text. - Code-point reverse. Reversing
a😀byieldsb😀a, not a broken emoji — the splitter walks code points rather than UTF-16 code units. - Local and instant. No network, no upload; every transform is pure string math in the page.
Worked example#
Paste a human-readable label into the input:
user first name
Switch the operation through the five naming conventions and watch the output pane:
- camelCase →
userFirstName - PascalCase →
UserFirstName - snake_case →
user_first_name - kebab-case →
user-first-name - CONSTANT_CASE →
USER_FIRST_NAME
Now try a messier identifier that mixes conventions:
HTTPServer v2
Because the splitter recognises the HTTP + Server boundary and the v + 2 boundary, the outputs stay readable rather than collapsing into httpservver-v2:
- kebab-case →
http-server-v-2 - snake_case →
http_server_v_2 - CONSTANT_CASE →
HTTP_SERVER_V_2
That is the difference between a transform that actually understands identifier structure and one that just lowercases and joins on a separator.
FAQ#
Why does HTTPServer not become h-t-t-p-server?#
Because the splitter treats a run of capitals followed by a capital-plus-lowercase word as an acronym plus a word. HTTPServer is read as HTTP + Server, which is almost always what you meant. A naive splitter that broke on every capital would produce unreadable slugs like h-t-t-p-server.
What is the difference between Title Case and Sentence Case?#
Title Case capitalises the first letter of every whitespace-delimited word (the quick fox → The Quick Fox), which is right for headlines and book titles. Sentence Case capitalises only the first alphabetic character of the whole string (the quick fox → The quick fox), which is right for prose and sentences. Pick based on what the text actually is.
When would I use half-width ↔ full-width conversion?#
East-Asian typography and some government/business forms expect full-width Latin letters and digits (ABC123) for visual alignment with CJK characters. Conversely, text copied from a Japanese source often arrives in full-width form and needs to be restored to ASCII before a regex or code parser will accept it. The two operations are exact inverses of each other.
Does reverse handle emoji correctly?#
Yes. The operation iterates by Unicode code point (via Array.from), not by UTF-16 code unit, so a character outside the basic multilingual plane — an emoji like 😀, a rare CJK ideograph, or a mathematical symbol — is reversed as one unit. Reversing abc😀def gives fed😀cba, with the emoji intact.
Is this useful for renaming a batch of files or variables?#
For a single identifier, yes — paste it in, pick the convention, copy out. For batch work you would normally script it, but this page is a quick way to confirm the exact output a convention produces before you commit it to a regex or codemod, especially for the awkward mixed-case inputs that tempt bugs.