How to Write Better ChatGPT Prompts (2026 Guide)

Practical techniques โ€ข 7 min read

TL;DR

Great prompts have four things: context (who/what), task (specific action), format (how to output), and examples (when possible). Iterate 2-3 times to refine.

The 4-Part Prompt Framework

1. Context

Tell the AI who it is and what it's dealing with.

You are a senior technical writer for a SaaS company.
The audience is engineers evaluating our API.

2. Task

State exactly what you want.

Write a 300-word intro for our webhooks documentation.

3. Format

Specify structure, length, tone.

Use H2/H3 headings. Include one code example.
Tone: friendly but technical. Avoid marketing language.

4. Examples (Optional but Powerful)

Show what good looks like.

Example intro style:
"Webhooks let you..." (calm, direct, no hype)

Advanced Techniques

Chain-of-Thought

Add "Think step by step" or "First, list your considerations, then answer." Improves reasoning on complex tasks by 20-40%.

Few-Shot Learning

Show 2-3 input/output pairs before the real question.

Q: What's the capital of France?
A: Paris

Q: What's the capital of Japan?
A: Tokyo

Q: What's the capital of Ghana?
A:

Role Prompting

Assigning an expert role improves quality: "As a nutritionist..." or "As a database administrator..."

Delimiters

Use triple backticks, XML tags, or dashes to separate input from instructions:

Summarize the following text in one sentence:

<text>
[your content here]
</text>

Constraints First

Put "must" and "must not" at the top, not buried at the end. Models read prompts sequentially and give more weight to early instructions.

Common Prompt Mistakes

Prompt Templates You Can Steal

For Writing

Role: You are a [role].
Task: Write [content type] about [topic].
Audience: [description].
Length: [word count].
Tone: [tone].
Must include: [3 key points].
Must avoid: [what to skip].

For Coding

Write a [language] function that:
- Input: [signature]
- Output: [signature]
- Constraints: [performance/style]
- Handle edge cases: [list]
Include type hints and docstring. Skip comments in code.

For Analysis

Analyze this data: [data]
Steps:
1. Identify key patterns
2. Explain each pattern's likely cause
3. Suggest one actionable insight
Format: Markdown with H3 headers per section.

How Prompts Differ Across Models

Related: ChatGPT vs Claude ยท Claude API Guide ยท AI Glossary

Get Daily AI News

5-minute briefing every morning. Free.

๐ŸŽต Follow on Spotify ๐ŸŽ Apple Podcasts