Skip to content

Tools

AI Code Explainer

Paste a snippet you did not write, a cryptic command or a stack trace. GPT-6 Luna explains what it really does, in plain words, at the depth you choose.

Code Explainer

The result will show up here

Understand code before you run it

Copying a snippet from a forum, inheriting a colleague's script or staring at a stack trace at the end of the day: the first question is always "what does this actually do?" Paste the code, command, regular expression or error message into the box and the code explainer tells you, in plain words, at the depth you choose.

The explanation comes from GPT-6 Luna. This tool is about understanding, not rewriting. It describes what the code really does, including surprising behavior, and only shows changed code when a fix is short and clearly needed. It is told not to invent library functions, to say when the answer depends on a version or on code you did not paste, and to warn loudly about commands that delete data or change system settings.

Five kinds of explanation

ExplanationWhat you get
Quick overviewWhat the code is for, its inputs and outputs, the main steps
Line by lineEach part quoted, then explained, in order
For a beginnerEach programming concept defined the first time it appears
Explain and spot problemsThe explanation plus likely bugs, edge cases, security and performance concerns, most serious first
What this error meansThe message in plain words, likely causes in your code, what to check

The language menu covers Python, JavaScript, TypeScript, Java, C#, C++, C, Go, Rust, PHP, Kotlin, Swift, Ruby, R, SQL, shell scripts, PowerShell, HTML and CSS, and regular expressions. "Detect automatically" works for nearly everything; choosing the language helps with short fragments that could belong to several. For regular expressions you also get two strings that match and one that does not.

Example: a cleanup command

This line appears in many server tutorials. We pasted it with "Explain and spot problems":

find . -name "*.log" -mtime +30 -exec rm {} \;

In about three seconds, the answer explained that it searches the current folder and every folder below it for files ending in .log that were last modified more than 30 days ago, and deletes each one. Then it listed concerns, most serious first: deletion is permanent with no confirmation, so run the same command with -print instead of the rm part first to see what would go; it reaches into every subfolder, so where you run it matters; and the age check counts whole 24-hour periods, which is not quite the same as calendar days. That first warning is the one that saves people from a bad afternoon.

Getting clearer explanations

  • Paste the whole function, not one line from the middle, when the line depends on variables defined above it.
  • For errors, include the full message and the code it points to. The first and last lines of a stack trace are usually the useful ones.
  • Say what you expected in a sentence above the code. The explanation then focuses on the gap between what you expected and what happens.
  • Remove secrets. API keys, passwords and connection strings should be replaced with dummy values before you paste. We do not store what you paste here (it passes through our gateway and OpenRouter to OpenAI), but keys do not belong in any text box.

Database queries have their own tool: the SQL helper can also write and fix queries. For a plain-language explanation of a technical idea rather than specific code, use explain it simply.

When to switch to the chat

The tool page is built for one snippet at a time. For a longer debugging session, or for writing new code, continue in the chat, where you can paste more files and ask follow-ups. For hard problems, turn on the Think chip, which switches the chat to GPT-6.1 Terra, a model that thinks briefly before it answers. Any explanation can be wrong, so test the claims that matter by running the code on sample input.

Code explainer FAQ

Can it explain code in a language not on the list?

Often, yes. Leave the setting on "Detect automatically". Popular languages get the most reliable explanations.

Will it fix my code?

It explains first. If a fix is short and obvious it shows it; for real rewrites, open the chat with Think on.

What language is the explanation in?

The language of any words you write around the code. If you paste code only, the explanation is in English.

Is it free?

Yes. Each explanation uses one of your free daily messages. To go further, try a step-by-step explanation in the chat.

Your question, answered now

No account, no card, nothing to download. Type what you want to know and the first words of the answer appear in a second or two.

Start a chat