TypeScript to Python Converter

Transform TypeScript code into clean, idiomatic Python with type hints

TS TypeScript
Py Python

How It Works

1

Paste TypeScript

Enter your TypeScript code with classes, interfaces, and type annotations.

2

Click Convert

Our converter maps types to Python, generates dataclasses and type hints.

3

Get Python Code

Copy the Python code or download it as a .py file for your project.

Type Mappings

TypeScript Type Python Type Description
stringstrText values
numberint / floatNumeric values
booleanboolTrue/false values
anyAnyDynamic type
voidNoneNo return value
Array<T>List[T]Generic list
T | nullOptional[T]Optional value
interface@dataclassData class
enumstr, EnumEnum class
classclassPython class

Watch How It Works