Starting points for your own code. Run them in the environment shown below.
Node.js 22+ · ES module (.mjs)
Current inputs apply only to fields used by the example. Selected files are not embedded.
Install dependencies
const text = "hello tools workspace";
const words = text.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2")
.split(/[\s_-]+/).filter(Boolean).map(word => word.toLowerCase());
const capital = word => word[0].toUpperCase() + word.slice(1);
console.log({
camelCase: words.map((word, i) => i ? capital(word) : word).join(""),
PascalCase: words.map(capital).join(""),
snake_case: words.join("_"),
"kebab-case": words.join("-"),
CONSTANT_CASE: words.join("_").toUpperCase(),
});
Put it to work
Convert identifiers to camelCase, snake_case, and more.
Details that matter
Format and meaning
Splits words at spaces, hyphens, underscores, and case boundaries.
Supported scope and limits
Text 1 MB
Split inputs that exceed the limit. If a format or algorithm is unsupported, choose a tool that matches your requirements instead of silently changing the format.