Flow to TypeScript Converter (Best-Effort)
Paste Flow-annotated source to get back a TypeScript file combining generated type declarations with a type-stripped implementation. Free online developer tool.
Paste Flow Source
TypeScript (Best-Effort)
TypeScript output will appear here...
Free Flow to TypeScript Converter (Best-Effort)
Paste Flow-annotated source to get back a single TypeScript file: a block of generated type declarations followed by the runnable implementation with its Flow types stripped. This is a best-effort combination of two separate conversions, not a first-class, fully type-annotated port — see the limitations below before relying on it.
How to Use It
Paste any Flow-annotated source into the input box, or click "Load Example." The tool runs two conversions and stitches the results together: it strips Flow types from your source to get a runnable implementation, and separately generates TypeScript type declarations from the same source. Both pieces are placed in one output file — declarations on top, implementation below.
Example
Given type Address = { city: string, zip?: string } and afunction greet(name: string, address: Address): string declaration, the output starts with a generated type Address = { city: string; zip?: string; } declaration block, followed by the plain function greet(name, address) { ... } implementation with its Flow annotations removed.
Common Use Cases
- Getting a quick, single-file TypeScript starting point from a small Flow module.
- Seeing both the inferred types and the stripped implementation side by side in one output.
- A first pass before manually re-annotating the implementation with real inline types.
FAQs
Are the parameter and variable types restored inline in the implementation?
No — and this is the most important limitation to understand. This tool combines two independent conversions: a types-only declaration block (generated the same way as the separate "Flow to TypeScript Declaration" tool) and a type-stripped implementation (generated the same way as the separate "Flow to Plain JavaScript" tool). The two are stitched together as a declaration block followed by an implementation — they are not merged, so the function bodies and variable declarations below the declaration block do not have their original parameter or variable types annotated in place. If you need that level of fidelity, use the "Flow to TypeScript Declaration" tool for the types and "Flow to Plain JavaScript" for the implementation separately, and merge the two by hand where precision matters.
Why not just generate fully-typed TypeScript directly?
Generating types and stripping types are two different, well-understood operations, but mapping a generated type declaration back onto the exact position of each parameter and variable in the implementation is a much harder problem with no reliable general solution — so this tool is deliberately transparent about combining the two outputs rather than pretending to solve that problem.
Is my code uploaded anywhere?
No — both conversions happen entirely client-side in your browser. Nothing you paste is sent to a server.
