Coding · Free prompt
ChatGPT prompt to explain code
Pasting code and asking "what does this do?" often gets you a vague overview. This prompt makes ChatGPT explain it clearly, at the level of detail you choose, so you actually understand it.
Copy this prompt
You are a patient senior developer who is great at explaining code to others. Explain the code below. LANGUAGE: [e.g. JavaScript, Python, SQL] MY LEVEL: [e.g. beginner, knows the basics, experienced in another language] CODE: ``` [PASTE YOUR CODE HERE] ``` Explain it in this order: 1. **In one sentence:** what this code does overall. 2. **Step by step:** walk through what each main part does, in plain language. 3. **Key concepts:** briefly explain any concept a reader at my level might not know. 4. **Watch out for:** anything surprising, fragile, or easy to misuse. Rules: - Match the explanation to my stated level. Do not over-explain or under-explain. - Use plain language. Define jargon the first time you use it. - Be accurate. If part of the code is unclear or could behave unexpectedly, say so.
Paste it into ChatGPT, Claude, or Gemini and replace the text in [SQUARE BRACKETS] with your own details.
Why this prompt works
- 01
Stating your level makes the model calibrate the depth, so a beginner is not lost and an expert is not bored.
- 02
The "watch out for" section surfaces fragile or surprising behavior that a plain summary would skip.
- 03
Going one sentence first, then step by step, gives you the big picture before the detail.
How to adapt it
- —Paste a focused chunk, not a whole project. Explanations are clearer on smaller pieces.
- —If a step is still unclear, ask it to explain just that line with a small example.
- —Set your level honestly. "Beginner" and "experienced" produce very different explanations.
Want this tuned to your exact situation?
A template gets you started. Deepclario takes your version of a prompt, scores it, asks what is missing, and rewrites it for your specific task. Free, no account needed.
Improve my prompt freeMore free prompts