Skip to content

Free tool · Code

Code converter

Paste code and get it in JavaScript, TypeScript, Python, Java, Go, C#, PHP or Ruby, behaving exactly the same: 1 free run a day on GPT-6 Luna, no account needed. We ran every model's conversions against tests to see whose still work.

1 free run a day, no account needed

GPT-6 Luna

Up to 1,500 characters. No files, tools or web search in a free run. One free run a browser, and one a network each day, shared with the free message on our home page.

Try an example:

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 . Updated .

Code converter: three examples

Three inputs and the conversion a free run gave each, made once on September 29, 2026 with GPT-6 Luna and shown as it came back. The example buttons in the box above show the same.

Python to JavaScript

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.
JavaScript to Python

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.
Java to Go

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 19 models, GPT-6 Luna, GLM 5.3 Flash, DeepSeek V4.1 Flash and 13 more passed the most: 5 of 5. That includes GPT-6 Luna, the model a free run is on.

Run on October 9, 2026: 5 inputs on 19 models, each with this tool's own instructions.

Each model's results on the tool's test inputs
ModelPassedHard onesMessages used on ProCost per runTime per run
GPT-6 LunaOpenAIThe free run's model5 of 52 of 21 each, of 60 a day on Pro$0.000116.4 s
GLM 5.3 FlashZ.ai5 of 52 of 21 each, of 60 a day on Pro$0.00013.8 s
DeepSeek V4.1 FlashDeepSeek5 of 52 of 21 each, of 60 a day on Pro$0.00051.3 s
Gemini 3.8 FlashGoogle5 of 52 of 21 each, of 250 a month on Pro$0.00051.3 s
GLM 5.3Z.ai5 of 52 of 21 each, of 250 a month on Pro$0.00080.9 s
Mistral Large 4Mistral5 of 52 of 21 each, of 250 a month on Pro$0.007836.6 s
Grok 4.7xAI5 of 52 of 21 each, of 250 a month on Pro$0.025253.7 s
Claude Sonnet 5Anthropic5 of 52 of 21 each, of 125 a month on Pro$0.00322.8 s
Kimi K3Moonshot5 of 52 of 21 each, of 125 a month on Pro$0.00326.3 s
GPT-6 SolOpenAI5 of 52 of 21 each, of 125 a month on Pro$0.00346.8 s
GPT-6.1 SolOpenAI5 of 52 of 21 each, of 125 a month on Pro$0.003610.1 s
Gemini 3.1 Pro (preview)Google5 of 52 of 21 each, of 125 a month on Pro$0.00608.4 s
Claude Sonnet 5.5Anthropic5 of 52 of 21 each, of 125 a month on Pro$0.00806.0 s
Claude Opus 5.5Anthropic5 of 52 of 21 each, of 62 a month on Pro$0.026212.3 s
GPT-6 AstraOpenAI5 of 52 of 21 each, of 31 a month on Pro$0.019211.5 s
Claude Fable 5.1Anthropic5 of 52 of 21 each, of 31 a month on Pro$0.03377.4 s
Claude Haiku 5.5Anthropic4 of 52 of 21 each, of 60 a day on Pro$0.00055.3 s
DeepSeek V4 ProDeepSeek4 of 52 of 21 each, of 250 a month on Pro$0.008211.4 s
Claude Haiku 4.5Anthropic3 of 51 of 21 each, of 250 a month on Pro$0.00101.7 s
Passed: of the 5 test inputs, how many answers passed their check (an answer the provider failed to give isn't counted). Messages used: what each run counted as on Pro, and Pro's count on the model. Cost: what OpenRouter charged us per run, on average; in llmwise you pay per message, not per token. Time: from sending to the whole answer.

Side by side: python's % on negative minutes

The same input on GPT-6 Luna and GLM 5.3 Flash, 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}"
GPT-6 Luna
```javascript
function clock(minutes) {
    if (typeof minutes === "bigint") {
        const m = ((minutes % 1440n) + 1440n) % 1440n;
        const hours = m / 60n;
        const mins = m % 60n;
        return `${hours.toString().padStart(2, "0")}:${mins.toString().padStart(2, "0")}`;
    }

    const m = ((minutes % 1440) + 1440) % 1440;
    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 modulo is normalized to match Python; BigInt inputs are supported for arbitrary-size integers.
GLM 5.3 Flash
```javascript
function clock(minutes) {
    const m = ((minutes % 1440) + 1440) % 1440;
    return String(Math.floor(m / 60)).padStart(2, '0') + ':' + String(m % 60).padStart(2, '0');
}
```
Source: Python. JS `%` keeps the sign of the dividend, so negative minutes are wrapped with `((x % 1440) + 1440) % 1440` to match Python's non-negative modulo. Integer division via `Math.floor` and zero-padding via `padStart` replicate `:02d`.

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

  1. Paste the code: a function, a class or a short script. Up to 1,500 characters.

  2. Pick the language to convert it into.

  3. Press “Convert”. Without an account you see the start (1 free run a day, no account needed).

  4. 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

    Signed in, 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's free, and what signing up adds

  • Without an account: 1 free run a day, on GPT-6 Luna, shared with the free message on our home page. It takes up to 1,500 characters, writes up to about 600 tokens (roughly 450 words), and shows you the start of the conversion.

  • Signing up is free, with an email link and no card. llmwise accounts are for people 18 and older. The conversion you ran comes with you as your first chat, and you get 5 free messages on almost every model (all but Claude Fable 5.1 and GPT-6 Astra).

  • Signed in, paste up to 20,000 characters in a run. It runs on the model you pick, on your plan, shows the whole answer, and you can carry on in the chat with any model.

More free tools are on the tools page, and what each plan gives is on pricing.

Questions

Is the code converter free?

Yes. Without an account you get 1 run a day on GPT-6 Luna, shared with the free message on our home page: you see the start of the conversion, and the rest when you sign up. Signing up is free and adds 5 free messages on almost every model in llmwise (all but Claude Fable 5.1 and GPT-6 Astra; one of them can be on Claude Opus 5.5), with no card.

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?

Signed in, paste up to 20,000 characters, a whole file or module, on any of 19 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 19 models, GPT-6 Luna, GLM 5.3 Flash, DeepSeek V4.1 Flash and 13 more passed the most: 5 of 5. That includes GPT-6 Luna, the model a free run is on. 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. Free is 5 messages to try; sign in with an email link, no password or card.