AI tool · Code
Code converter
Paste code and get it in JavaScript, TypeScript, Python, Java, Go, C#, PHP or Ruby, behaving exactly the same, on any of 27 models. We ran every model's conversions against tests to see whose still work.
Runs on Plus and Pro, on the model you pick
By running it, you agree to the Terms and Privacy Policy and confirm you’re 18 or older. We keep what you send and its answer for 7 days, or in your account if you sign up.
Test runs checked .
Code converter: three examples
Three inputs and the conversion GPT-6 Luna gave each, made once on September 29, 2026 and shown as it came back. The example buttons in the box above show the same.
def word_counts(text): counts = {} for word in text.lower().split(): counts[word] = counts.get(word, 0) + 1 return counts
```javascript
function word_counts(text) {
const counts = Object.create(null);
for (const word of text.toLowerCase().split(/\s+/u).filter(Boolean)) {
counts[word] = (counts[word] ?? 0) + 1;
}
return counts;
}
```
Source: Python. JavaScript uses Unicode whitespace splitting to match Python’s `split()` behavior; the result has no inherited object properties.function groupBy(items, key) { return items.reduce((groups, item) => { (groups[item[key]] ||= []).push(item); return groups; }, {}); }
```python
from typing import Any, Hashable, Iterable
def groupBy(items: Iterable[Any], key: Any) -> dict[Hashable, list[Any]]:
groups: dict[Hashable, list[Any]] = {}
for item in items:
group_key = item[key]
if group_key not in groups:
groups[group_key] = []
groups[group_key].append(item)
return groups
```
Source language: JavaScript. Python dictionary keys must be hashable; JavaScript coerces object keys to strings (except symbols), so non-string keys can behave differently.public static boolean isLeapYear(int year) { return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0; }
```go
func isLeapYear(year int) bool {
return (year%4 == 0 && year%100 != 0) || year%400 == 0
}
```
Source language: Java.
Go’s `%` has the same sign behavior as Java’s for negative integers, so the result is preserved.Which AI model is best at this? We tested every one
In our test runs of 5 Code converter inputs on 27 models, GPT-6 Luna, Claude Haiku 5.5, DeepSeek V4.1 Flash and 21 more passed the most: 5 of 5. That includes Claude Haiku 5.5 (an everyday model on every plan).
Run on November 19, 2026: 5 inputs on 27 models, each with this tool's own instructions.
| Model | Passed | Hard ones | Messages used on Pro | Cost per run | Time per run |
|---|---|---|---|---|---|
| GPT-6 LunaOpenAI | 5 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0001 | 11.0 s |
| Claude Haiku 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0005 | 4.8 s |
| DeepSeek V4.1 FlashDeepSeek | 5 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0009 | 3.1 s |
| Gemini 3.8 FlashGoogle | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0004 | 2.9 s |
| GLM 5.3Z.ai | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0009 | 2.1 s |
| GPT-6.1 TerraOpenAI | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0025 | 11.4 s |
| DeepSeek V4 ProDeepSeek | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0069 | 12.8 s |
| Mistral Large 4Mistral | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0093 | 49.8 s |
| Grok 4.7xAI | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0210 | 46.5 s |
| Claude Sonnet 5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0032 | 3.0 s |
| GPT-6.1 SolOpenAI | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0034 | 18.7 s |
| Kimi K3Moonshot | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0036 | 4.3 s |
| GPT-6 SolOpenAI | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0041 | 9.3 s |
| Gemini 4 HydrogenGoogle | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0055 | 7.8 s |
| Kimi K3.1 ProMoonshot | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0067 | 15.3 s |
| GPT-6.2 SolOpenAI | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0069 | 7.9 s |
| Gemini 3.1 Pro (preview)Google | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0075 | 9.8 s |
| Claude Sonnet 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0087 | 6.5 s |
| Gemini 4 ArgonGoogle | 5 of 5 | 2 of 2 | 1 each, of 62 a month on Pro | $0.0020 | 8.2 s |
| Gemini 4 CarbonGoogle | 5 of 5 | 2 of 2 | 1 each, of 62 a month on Pro | $0.0124 | 31.7 s |
| Claude Opus 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 62 a month on Pro | $0.0224 | 9.7 s |
| GPT-6 AstraOpenAI | 5 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0191 | 12.7 s |
| Claude Fable 5.1Anthropic | 5 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0351 | 8.4 s |
| Claude Fable 5.2Anthropic | 5 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0433 | 11.0 s |
| GLM 5.3 FlashZ.ai | 4 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0001 | 2.3 s |
| GPT-6.2 AstraOpenAI | 4 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0182 | 8.6 s |
| Claude Haiku 4.5Anthropic | 3 of 5 | 1 of 2 | 1 each, of 250 a month on Pro | $0.0011 | 1.7 s |
Side by side: python's % on negative minutes
The same input on GPT-6 Luna and Claude Haiku 5.5, as each answered it, unedited.
Convert this code, in one code block, keeping the same names and exactly the same behaviour for every input. Then at most three lines on the differences you handled.
---
def clock(minutes):
m = minutes % 1440
return f"{m // 60:02d}:{m % 60:02d}"```javascript
function clock(minutes) {
const value = BigInt(minutes);
const m = ((value % 1440n) + 1440n) % 1440n;
const hours = m / 60n;
const mins = m % 60n;
return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
}
```
Source: Python. BigInt preserves integer precision and the modulo is adjusted to match Python’s nonnegative remainder for negative inputs.```javascript
function clock(minutes) {
// Python's % always returns a result with the sign of the divisor (0..1439 here),
// so normalise negative inputs the same way.
const m = ((minutes % 1440) + 1440) % 1440;
// Python's // on non-negative integers equals Math.floor; keep it explicit.
const hours = Math.floor(m / 60);
const mins = m % 60;
return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
}
```
Source language: Python. Negative inputs are wrapped with a double modulo so they match Python's floored modulo instead of JavaScript's truncated remainder. Zero-padding to two digits mirrors Python's `:02d` format.How the inputs are scored
- Tests: the reply's JavaScript runs in a locked-down sandbox against our tests, edge cases included; it passes only if every test does.
The inputs: a python slugify, java running totals, ruby initials, with extra spaces, python's % on negative minutes, and python's sort order, capitals first. Every model gets the tool's own instructions and up to Pro's reply limit. The method is the same as our other test runs.
How to use the Code converter
Paste the code: a function, a class or a short script. Up to 1,500 characters.
Pick the language to convert it into.
Press “Convert”. It runs on your plan (Plus or Pro) on the model you pick, and the whole answer streams in.
Run the original and the conversion on the same inputs, edge cases included, before you replace anything.
Tips for a better answer
Show how it's called
Paste the function with the code that calls it, or an example input and output. The conversion then matches how it's really used.
Name the version
Say which runtime you're on (“Node 22”, “Python 3.12”, “Java 21”). Newer versions have built-ins that make the code shorter.
Small pieces
Convert one function at a time and test each one. A 2,000-line file converted in one go hides its mistakes.
Tests that run on both
Ask the same model for tests of the original's behaviour, then run them on both versions.
What a good conversion looks like
Same inputs, same outputs
Run the original and the conversion on the same inputs, including an empty one, a negative number and text with odd spacing. Where the outputs differ, the conversion is wrong.
Arithmetic on negatives
Python's -7 % 3 is 2; JavaScript's is -1. Python's // rounds down; a naive Math.trunc rounds toward zero. Check every % and division when negatives can occur.
Library functions that look alike
Ruby's split() drops empty pieces; JavaScript's split(" ") keeps them. Python sorts “B” before “a”; localeCompare doesn't. These small differences are where converted code quietly breaks.
Idiomatic, not literal
A good conversion uses the target language's own style (a list comprehension becomes map, a dict becomes an object or Map), not a line-by-line transliteration.
What you need to run it, and what a run gives
Running it takes a plan, Plus or Pro. There's no free plan or trial: a plan is paid at checkout and renews every month until you cancel. Cancel in two clicks in Settings → Billing and you keep your plan to the end of the month you paid for. llmwise accounts are for people 18 and older.
Paste up to 20,000 characters in a run. It runs on the model you pick, shows the whole answer, and you can carry on in the chat with any model your plan has, or ask another model the same thing.
A run counts on your plan like any other message: the table above shows what one counted as on Pro, model by model.
More AI tools are on the tools page, and what each plan gives is on pricing.
Questions
Is the code converter free?
No: there's no free plan or trial. It runs on Plus and Pro, on any model your plan has; Claude Fable 5.2, GPT-6.2 Astra, and their earlier versions need Pro. Paid monthly from the day you start. Cancel in two clicks in Settings → Billing.
Which languages can it convert between?
From any common language: it reads the code you paste and names the language it found. Into JavaScript, TypeScript, Python, Java, Go, C#, PHP or Ruby.
Does the converted code actually work?
Our test runs gave every model five functions in Python, Java and Ruby, had it convert each one to JavaScript, and ran the result against tests in a sandbox. We test conversions into JavaScript because that's what our sandbox runs; the page shows which models passed.
Can it convert a whole file?
Yes: paste up to 20,000 characters, a whole file or module, on any of 27 models, and ask follow-ups in the same chat (“now add types”, “use async/await”).
What about libraries and frameworks?
It maps each library call to the target's nearest equivalent and says when there isn't one. A framework migration (Django to Express, say) is more than a conversion: do it file by file, and test each one.
Which AI is best for this, in your tests?
In our test runs of 5 Code converter inputs on 27 models, GPT-6 Luna, Claude Haiku 5.5, DeepSeek V4.1 Flash and 21 more passed the most: 5 of 5. That includes Claude Haiku 5.5 (an everyday model on every plan). The table on this page has every model's result, what a run counts as on Pro, and the time it took.
Claude, GPT, Gemini, DeepSeek, Grok, Kimi, GLM, and Mistral, in one chat.
See what a message costs before you send it. Every plan is month to month: cancel in two clicks. Sign in with an email link, no password.