Processed online by Toolvito
Programming Language Converter
Paste your code and choose the direction. The converted code is shown only when it parses without errors and keeps the names of your classes and functions.
What you can do
- Convert code with AI: Java to Kotlin, Kotlin to Java, JavaScript to TypeScript, Java to TypeScript or TypeScript to Java, up to 4,000 characters at a time (one class or a few functions). A language model that runs on the Toolvito server writes the code; then code checks it.
- Convert TypeScript to JavaScript: the types are removed from the parse tree, without AI. Enums become a plain object, and constructor parameter properties become this.x = x. You can keep every line and column where it was.
- Check the syntax of JavaScript, TypeScript, TSX, Java or Kotlin: each error with its line and column, and JSX closing tags that do not match.
- See type conversions: what Number(), parseInt(), parseFloat(), String(), toFixed() and Boolean() give for your values, with TypeScript code to copy.
How the AI result is checked
- Your code must parse first. Fix syntax errors before you convert.
- The answer is parsed in the new language. If it has syntax errors, the model gets one more try with the error positions. You see code only when it parses.
- Every class, interface, enum, function, method and field of your code must be in the answer (a Java getName() may become the Kotlin property name).
- The answer may add no numbers (other than 0 and 1) and no texts that your code does not have.
- From JavaScript to TypeScript, the types are removed from the answer again by code and the result is compared with your JavaScript. A difference is shown as a note.
What it does not do
It does not compile, type-check or run your code, and it converts one file at a time, not a whole project. Build and test the result before you use it. For TypeScript types, run the TypeScript compiler.
Type conversions in TypeScript
TypeScript types are removed before the code runs, so converting a string to a number works as in JavaScript: Number(value) needs the whole text to be a number (empty text gives 0), parseInt(value, 10) reads the digits at the start, and parseFloat(value) reads a decimal number at the start. Try your own values with See type conversions.