What is removed and what is kept
| TypeScript | JavaScript output |
|---|---|
| let n: number = 1 | let n = 1 |
| interface / type | removed |
| enum Role { … } | plain object |
| x as User | x |
| import type … | removed |
Related tools
Frequently asked questions
How do I convert TypeScript to JavaScript?
Paste the code; type annotations, interfaces, type aliases and type-only imports are removed, leaving runnable JavaScript.
Does it check my types?
No – it only removes them. Use tsc --noEmit for type checking.
How are enums handled?
Enums are compiled into plain JavaScript objects with the same values.
Is modern syntax downlevelled to ES5?
No – syntax such as async/await, classes and optional chaining is kept. Use Babel or esbuild if you need to support very old browsers.
Can it handle React TSX?
Yes – tick the TSX option; JSX is turned into React automatic-runtime calls.
What happens to unused imports?
Imports used only as types are removed, as TypeScript does. Tick “keep imports” if an import is needed for its side effects.
What about decorators?
Experimental decorators are not supported by this fast converter; use tsc for decorator-heavy code such as Angular.
Which engine is used?
Sucrase, a fast TypeScript-to-JavaScript transformer (MIT licence), plus js-beautify for tidy output.
Are namespaces supported?
Simple namespaces are; complex ones are better compiled with tsc.
Can I convert JavaScript to TypeScript?
Valid JavaScript is valid TypeScript – rename the file to .ts and add types gradually.
Does it keep comments?
Yes, most comments are kept.
Why are there blank lines where interfaces were?
Line positions are preserved so error messages still point to the right place; tidy formatting removes most of them.
Is it free?
Yes – no sign-up, no limits and no watermark.
Is my code uploaded?
No. Everything runs in your browser; nothing you paste is sent to Docelora.
Can I use the output in commercial projects?
Yes. The output is yours to use however you like.
Does it work on a phone or tablet?
Yes – the layout adapts to small screens, though long code is easier to read on a larger display.
How do I copy the result?
Use the Copy button under the result, or Download to save it as a file.
Which browsers are supported?
Current versions of Chrome, Edge, Firefox and Safari.
Is there a size limit?
There is no fixed limit, but very large inputs can take a few seconds on older devices.
Can I suggest an improvement?
Yes – use the Contact page to tell us what would make the tool more useful.
Last reviewed: 15 November 2026.