TypeScript String Union Generator
Turn unique text lines into an escaped string-literal union.
- Free
- No sign-up
- Runs in your browser
- Nothing uploaded
Scope: Output is TypeScript source text only and is never executed.
Workbench
Inputs stay on this page. Press Ctrl or ⌘ + Enter to run.
How to use TypeScript String Union Generator
Fill in the fields:
- Type name.
- Member kind: String literals, Numbers.
- One value per line.
Press “Generate union”.
Copy the typescript source, or download it as union-type.ts.

