Small SEO Tools

How to Split CamelCase Names into Readable Labels

A name such as imageURL is convenient in code but may need spaces when used as a display label. Simply inserting a space before every capital would also split an acronym into separate letters. Use two checked passes on a copy, then review the wording for its destination.

This procedure handles declared ASCII letter transitions. It creates display text; it does not rename source-code identifiers, database fields or JSON property names.

Keep the original names and choose the label rules

Start with this short list, one name on each line:

imageURL
XMLParser
userID2

The intended display labels are image URL, XML Parser and user ID2. Keep each letter and digit in its original order and case. The edit only inserts spaces at the selected transitions.

Save the original separately. If these names are keys used by software, keep those keys unchanged and store or enter the labels in the separate place your application provides for display text. A readable label does not establish that a renamed key would still work.

Separate a capital run from the next capitalized part

Open Find and Replace Text and paste the original list into Your text. Enable Use regular expression, Match case and Replace all. Leave Whole word only off.

Enter this directly in Find, without surrounding slashes or flags:

([A-Z]+)([A-Z][a-z])

Set Replace with to $1 $2, including the single space between the tokens, and select Replace. The current tool reports one replacement and produces:

imageURL
XML Parser
userID2

The first parenthesized group captures a run of ASCII capitals. The second captures a capital followed by an ASCII lowercase letter. In XMLParser, the groups are XML and Pa; their letters remain present with a space between them. MDN explains the numbering of capturing groups.

Keep Match case enabled. The distinction between [A-Z] and [a-z] is essential to this rule.

Separate a lowercase letter or digit from a capital

The output is separate from the input. Put the complete first-pass result back into Your text before continuing. Keep the same four checkbox choices and change only Find to:

([a-z0-9])([A-Z])

Keep Replace with as $1 $2 and select Replace. Expect two replacements:

image URL
XML Parser
user ID2

This pass separates eU and rI. It does not split the capital letters inside URL or ID, and the final digit remains attached. The tool supports the numbered replacement tokens used here; MDN documents the underlying replacement-string syntax.

Run the passes in this order and review each intermediate result. In our tests, the unchanged current tool code executed both registered Replace actions. A separate character-by-character check independently confirmed the final boundaries, letter order and retained line breaks.

Review acronyms, digits and ambiguous names

We also tested these controls through both passes:

Original Final display copy
HTTPRequest HTTP Request
simpleName simple Name
version2Value version2 Value
URL URL
already spaced already spaced
snake_case snake_case

The rules do not understand names or decide the final editorial style. Separate tests turn iPhoneURL into i Phone URL and OAuthToken into O Auth Token. The non-ASCII boundary in caféURL remains joined. These outcomes need a manual decision rather than acceptance as universally correct labels.

Read the labels in the actual interface or document. Restore intended name spellings, decide how digits should read, and preserve any required abbreviations. If the destination uses sentence case, the heading capitalization guide covers that separate editorial pass.

Before copying a larger result, compare it with the saved source and confirm that only intended spaces were added. Use the draft comparison procedure for that review, then check that the original identifiers still occupy their original software fields.