Back to cookbook

Chain-of-Thought Prompt for Step-by-Step Reasoning

16 views Published

Make this prompt yours

Share

This is a chain-of-thought prompt that gets ChatGPT, Claude, or Gemini to reason through a problem step by step before giving a final answer, instead of jumping straight to a conclusion. It's built for anyone working through a math problem, a logic puzzle, a multi-step business decision, or any task where the model's reasoning matters as much as its answer.

Without an explicit instruction to think it through, models often skip straight to an answer and skip steps that would have caught an error. This template forces a visible reasoning trace followed by a clearly separated final answer, so you can check the logic before you trust the result.

Prompt template

Make this prompt yours

prompt-template
138 tokens
You are a careful problem-solver who reasons step by step before answering. Problem: [DESCRIBE THE PROBLEM OR QUESTION] Relevant facts or constraints: [LIST ANY NUMBERS, RULES, OR CONSTRAINTS] Instructions: 1. Work through the problem step by step, showing each step of your reasoning. 2. Double-check any calculation before moving to the next step. 3. If a fact is missing, state what you're assuming instead of guessing silently. 4. After your reasoning, write "Final answer:" on its own line followed by a single, direct answer. Output format: Reasoning: [step-by-step reasoning] Final answer: [one direct answer]

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
50 tokens
Problem: A team of 5 people can complete a project in 12 days. If 3 more people join with the same productivity, how many days will the project take? Relevant facts or constraints: Assume all workers have equal, constant productivity.

When to use it

  • Math word problems, logic puzzles, or multi-step calculations
  • Decisions with several weighted factors, like choosing between vendors
  • Debugging why an earlier answer from the model was wrong
  • Any task where you need to audit the reasoning, not just the answer

Best practices

  • Ask for the reasoning and the final answer in two clearly labeled sections
  • Give the model permission to say it's unsure instead of guessing
  • Keep the problem statement precise; vague inputs produce vague reasoning
  • Re-run with "check your work" as a follow-up when the stakes are high

Common mistakes

  • Asking for "the answer" without reasoning, then trusting the first number given
  • Burying the actual question inside a long paragraph of context
  • Not specifying units or constraints, letting the model assume them
  • Accepting a plausible-looking reasoning trace without checking it yourself

FAQs

Does chain-of-thought prompting actually improve accuracy?

For multi-step math, logic, and planning tasks, asking a model to reason before answering generally produces more reliable results than asking for a direct answer, because it gives the model room to catch its own errors mid-reasoning.

Should I always ask for step-by-step reasoning?

No. For simple factual lookups or short creative tasks it just adds noise. Save it for problems with multiple steps or where you need to verify the logic.

Can I hide the reasoning from the end user but still use this prompt?

Yes. Ask the model to keep the reasoning section in its response for you to review, then only forward the final answer line to whoever needs the result.

Does this work the same way in ChatGPT, Claude, and Gemini?

The structure works across all three. Some models are more verbose by default; if the reasoning gets too long, add a constraint like "keep each step to one sentence."

Found this prompt useful? Share it.

Share

More in Prompt Fundamentals & Techniques

Prompt Fundamentals & Techniques

AI Prompt for Analogical Prompting to Generate Self-Created Examples Before Answering

Analogical prompting is a technique where, instead of you writing few shot examples by hand, you ask the model to first recall or invent sim…

You are solving a problem using analogical reasoning.

STEP 1: Before solving the problem below, recall or generate 2 related problems that share a similar underlying structure or reasoning pattern. For each one, briefly state the problem and how it would be solved.

STEP 2: Identify what reasoning approach or pattern those examples have in common.

STEP 3: Apply that same reasoning approach to solve the actual problem below. Show your work step by step.

ACTUAL PROBLEM:
[YOUR QUESTION OR PROBLEM HERE]

OUTPUT FORMAT:
- Related Examples: (2 short examples with solutions)
- Shared Pattern: (1-2 sentences)
- Final Answer: (clearly labeled, with step-by-step reasoning for the actual problem)

Make this prompt yours

Prompt Fundamentals & Techniques

AI Prompt for Multi-Persona Debate to Stress-Test an Idea

Multi persona debate prompting is a technique where you ask a model to argue a decision or idea from several distinct, opposing viewpoints b…

You are facilitating a structured debate between multiple expert personas to help evaluate a decision.

DECISION TO EVALUATE:
[DESCRIBE THE DECISION OR IDEA, e.g. "Should we raise our subscription price by 20% for new customers?"]

CONTEXT:
[RELEVANT BACKGROUND: company size, current numbers, constraints, timeline]

PERSONAS:
1. [PERSONA 1 — e.g. "Risk-Averse CFO who prioritizes cash flow stability and customer retention"]
2. [PERSONA 2 — e.g. "Aggressive Growth Lead who prioritizes revenue growth and market share"]
3. [PERSONA 3 — e.g. "Customer Success Manager who prioritizes existing customer satisfaction"]

TASK:
1. Have each persona give a 2-3 sentence opening argument from their specific incentive and priorities
2. Run one round of rebuttal where each persona directly challenges at least one point from another persona
3. After the debate, provide a neutral synthesis that lists the strongest point from each side
4. End with a short, clearly labeled recommendation and the key risk to monitor if that recommendation is followed

CONSTRAINTS:
- Keep each persona's arguments distinct and grounded in their stated priorities, not generic pros/cons
- Do not let the synthesis simply average the positions — it should make an actual call
- Flag any assumption the personas are relying on that isn't confirmed in the context provided

OUTPUT FORMAT:
Label each section clearly: Opening Arguments, Rebuttals, Synthesis, Recommendation.

Make this prompt yours

Prompt Fundamentals & Techniques

AI Prompt for Step-Back Prompting to Improve Reasoning Accuracy

Step back prompting is a technique for getting more accurate answers from ChatGPT, Claude, or Gemini by asking the model to first state the…

ROLE: You are a careful reasoning assistant that solves problems by first identifying general principles.

TASK: Answer the following specific question: [SPECIFIC QUESTION OR PROBLEM]

CONSTRAINTS:
1. Before answering, state the general principle, rule, or concept that applies to this type of problem. Write this as a standalone statement that would be true for any similar problem, not just this one.
2. Then explain how that general principle applies to the specific details given.
3. Only after steps 1 and 2, give your final answer.
4. If your final answer seems to contradict the general principle you stated, flag the contradiction and revise instead of ignoring it.

OUTPUT FORMAT:
General Principle: [the abstracted rule]
Application: [how the rule applies to this specific case]
Final Answer: [the specific answer]

DOMAIN CONTEXT: [OPTIONAL: SUBJECT AREA, E.G. PHYSICS, TAX LAW, SOFTWARE DEBUGGING]

Make this prompt yours