Code Explainer

Paste code you did not write and this code explainer walks it against its own line numbers — with mutated arguments, swallowed errors and everything else that passes review and fails in production kept in a section of its own.

Free · No signup · 15 languages detected automatically

Paste code you did not write. This code explainer names the language, walks the logic against the real line numbers, and keeps what is surprising in a section of its own — mutated arguments, swallowed errors, the things that pass review and fail in production.

Language

The logic in order, grouped into steps.

17 lines · 401 characters

Your code is sent to a model to be explained and is not stored — there is no account, no history, and nothing is written to a database. It is still a third-party API call, so this is not the place for anything under an NDA or containing live credentials.

See a worked example

Here is the discount function every codebase eventually grows, and what the walkthrough returns for it.

def apply_discount(order, codes):
    total = 0
    for item in order["items"]:
        total += item["price"] * item["qty"]

    for code in codes:
        rule = DISCOUNT_RULES.get(code)
        if rule:
            total = total - (total * rule["percent"] / 100)
            order["items"].pop()

    try:
        order["total"] = round(total, 2)
    except:
        pass

    return order["total"]

Detected: Python

Summary. Totals the line items on an order, applies every discount code that matches a known rule, writes the rounded result back onto the order and returns it.

Lines What they do
1–4 Sums price × quantity across the order's items into a running total.
6–8 Walks the supplied codes and looks each one up in the discount rules, skipping codes with no matching rule.
9 Subtracts the rule's percentage from the running total.
10 Removes an item from the order's item list.
12–15 Writes the rounded total back onto the order.
17 Returns the stored total rather than the local variable.

What will bite you

  • Line 10 mutates the caller's order — order["items"].pop() deletes the last item, and nothing in the function name suggests it removes anything.
  • Discounts on line 9 compound rather than sum. Two 20% codes take 36% off, not 40%.
  • Lines 14–15 swallow every exception, including the TypeError a string price would raise. Worse, order["total"] is then never set, so line 17 raises KeyError — the bare except does not prevent the crash, it just moves it one line down and strips the useful traceback.
  • Line 9 uses floating-point arithmetic on money, so the result drifts by cents at scale.

Not answerable from this snippet

  • DISCOUNT_RULES is defined elsewhere. Whether a code can carry a percentage above 100 — which would make the total negative — depends entirely on it.

Coverage. 14 of 14 substantive lines explained.

The first two findings are the ones that matter, and neither is visible from reading the function name. That is the difference between a summary and an explanation.

Free tool vs. full Tekk

The free tool gives you the structured first draft. Tekk grounds the rest of the work in your actual codebase.

Feature Free tool Tekk
Explains a pasted snippet
Line-anchored, not a prose blob
Separate section for what will break
Reports which lines it did not explain
Resolves the constants and helpers the snippet calls
Finds every caller before you change a signature
Reads a whole file, or a whole directory
Turns the findings into tracked work

How it works

  1. 1

    Paste it and let the language be detected

    A function, a query, a regex, a shell one-liner someone left in a runbook. Fifteen languages are recognised from the syntax itself, so there is no dropdown to hunt through first — and the guess is shown, and overridable, rather than assumed silently.

  2. 2

    Choose how much detail you want

    Summary is one paragraph. Walkthrough groups the logic into steps. Line by line annotates every substantive line. This code explainer treats those as three different questions, because "explain this" means something different when you are triaging an incident than when you are about to refactor.

  3. 3

    Read the explanation beside the code

    Each note sits in the same row as the lines it describes, so you are never mapping a paragraph back onto a snippet by hand. Anything the answer skipped is marked in place and counted underneath — which is the one thing a chat window can never tell you about its own reply.

Frequently asked questions

What does this code do?
That is the question this code explainer exists to answer. Paste the snippet, pick a depth, and you get a plain-language summary, an explanation pinned to each run of lines, and a separate list of the behaviour that would surprise a reviewer. The last part is usually the reason you were reading the code in the first place.
Which languages does it handle?
Detection covers TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, SQL, shell, YAML, JSON, HTML and CSS. The model will make sense of others too — the detector just will not name them, so pick the closest match or leave it unset and it will identify the language itself.
Is there an ai code explainer that works on more than one function?
This one takes up to about 400 lines at a time, which covers a file of moderate size. Beyond that, paste the part you actually need. Any ai code explainer working from a snippet is limited the same way: it can only reason about what you gave it, and a truncated file produces confident answers about code it never saw.
Why does it show which lines it did not explain?
Because otherwise you have no way of knowing. A model will happily explain the interesting two-thirds of a function and stop, and the answer reads as complete either way. The line ranges it cited are checked against your actual source in your browser, and anything it skipped is marked in place and counted — that check is arithmetic, not another opinion from the model.
What if it cites a line number that does not exist?
You will be told. Every cited range is validated against the source you pasted, and a citation past the end of the file is flagged rather than quietly dropped. A model that has lost track of the line numbers has probably lost track of other things too, and you should know that before trusting the rest of the answer.
How is this different from pasting the code into ChatGPT?
You get the same model either way. What differs is the shape of the answer: a code explainer built as a page can anchor notes to line numbers rather than returning a prose blob, keep a dedicated section for what will break, list explicitly what the snippet alone cannot determine, and report coverage. The prompt behind it has been written once, carefully, instead of improvised each time.
Can it explain code in a language I do not know?
That is the common case — an unfamiliar language is exactly when you cannot skim. Set the language manually if the detector is unsure, and use the line-by-line depth, which annotates each substantive line rather than assuming you can follow the shape of the code on your own.
Does it work as a python code explainer specifically?
Yes, and Python is the worked example on this page. As a python code explainer it looks for the failure modes the language actually has: bare `except` clauses that swallow everything, mutable default arguments, mutation of a passed list or dict, and integer-versus-float division changing a result.
Will it just guess when something is missing?
It is instructed not to, and what it could not determine is listed separately. A snippet that calls an undefined constant, imports a module you did not paste, or inherits from a base class it cannot see gets a note naming that specific thing and what it decides. Plausible invention is the worst failure mode here, so it is called out rather than hidden.
Can I get the explanation as a comment in my code?
Yes — the copy button formats it as a comment block in the detected language, so it can go straight above the function. Reading an explanation on a web page helps you once; a comment committed next to the code helps whoever opens the file next, which is often you in four months.
Do you store the code I paste?
No. It is sent to a model to be explained and is not written to a database — there is no account and no history. It is still a third-party API call, so do not paste anything under NDA or containing live credentials. The language detection, line numbering and coverage check all run locally in your browser.
Is there a limit on how much I can explain code for free?
Three runs, then it asks you to connect a repo. There is no card and no trial. If you mostly want to explain code one snippet at a time, three is usually more than a single sitting needs.
Why is this free, and what is Tekk?
Tekk is a spec-driven development platform for people building software with AI coding agents. A pasted snippet is the hardest version of this problem, because the constants, callers and helpers are all missing; connect a repo and those stop being unknowns. The tool here is genuinely free and there is no upsell inside it.

Want a real spec for what you’re building?

Drop a sentence. Tekk grounds it in your actual code and turns it into an executable plan.

Free to try · Connect GitHub during signup