What Is Prompt Engineering? A Simple Guide With Real Examples

Pritam Sonone
Verified byPritam Sonone
Read time20 min read
What Is Prompt Engineering? A Simple Guide With Real Examples
Share
Quick answer

Prompt engineering is the skill of writing clear instructions for an AI tool so it gives you the answer you need, again and again. A good prompt says the goal, gives context, sets a role, asks for a format and length, and shows an example. Then you test the answer and improve the prompt. OpenAI, Anthropic and Google all teach the same core ideas in their official guides.

You type a question into ChatGPT, Gemini or Claude, and the answer is too long, too vague, or just wrong. Most of the time the tool is fine. The question was not clear enough. Prompt engineering is the fix.

On 3 Dec 2026 I read the official prompt guides from OpenAI, Anthropic (the company behind Claude) and Google, and marked up screenshots of the parts that matter most. Every rule below comes from those pages. The before and after prompts are my own examples, written to show each idea in plain words.

Key takeaways

1. Say what you want, who it is for, and how long. 2. Paste the facts the AI needs. 3. Ask for a shape: table, bullets, email. 4. Show one example if style matters. 5. Read the answer, then fix the prompt, not just the answer. 6. Never paste passwords, Aadhaar or PAN numbers. 7. Check facts yourself.

On this page16 sections

What is prompt engineering?

A prompt is what you give an AI model: a question, an instruction, some text to work on, or even an image. Prompt engineering is the work of writing and improving that input so the output is right for your job.

Here is how the three biggest AI companies describe it, in short:

SourceWhat they say (paraphrased)
OpenAI API guideWriting effective instructions so a model consistently makes content that meets your needs. Because answers vary each time, it is a mix of art and science.
OpenAI Help (ChatGPT)Designing and improving the input you give a language model to guide its answer.
Google CloudPrompt design is creating prompts that get the answer you want. The repeated loop of changing a prompt and checking the answers is sometimes called prompt engineering.
Anthropic (Claude)Start with clear success goals, a way to test against them, and a first draft prompt. Then improve the draft.

Guides read 3 Dec 2026.

OpenAI's prompt engineering guide with its definition and its advice to build tests highlighted, 3 Dec 2026
OpenAI's prompt engineering guide with its definition and its advice to build tests highlighted, 3 Dec 2026

Notice the common word: consistently. A lucky answer once is not prompt engineering. A prompt that works for 50 different inputs is.

Prompt design vs prompt engineering

Google uses both words. Writing one good prompt is prompt design. Testing it, changing it and testing again is prompt engineering. In daily use, most people mean the same thing by both.

Google Cloud Introduction to prompting page with the prompt design definition and the four prompt components highlighted, 3 Dec 2026
Google Cloud Introduction to prompting page with the prompt design definition and the four prompt components highlighted, 3 Dec 2026

The parts of a good prompt

Google’s Cloud guide splits a prompt into parts. Only the task is required. The rest are optional, but each one makes the answer better when you need it.

PartWhat it doesShort example
Task or objective (required)What you want doneSummarise this report for my manager.
Role or personaWho the AI should act asYou are a GST consultant.
InstructionsSteps to followFirst list the dates, then the amounts.
ConstraintsRules and limitsDo not give legal advice. Use only the text below.
ToneHow it should soundFriendly, simple, no jargon.
ContextFacts the AI needsOur shop is in Pune and sells only organic tea.
Few-shot examplesSamples of a good answerInput: … Output: …
Reasoning stepsAsk it to think step by stepExplain your reasoning step by step.
Response formatThe shape of the answerA table with 3 columns.
RecapRepeat key rules at the endRemember: 150 words, Hindi, no emojis.

Guides read 3 Dec 2026.

Google Cloud prompting strategies table with the Persona, Reasoning steps and Response format rows highlighted, 3 Dec 2026
Google Cloud prompting strategies table with the Persona, Reasoning steps and Response format rows highlighted, 3 Dec 2026

OpenAI suggests almost the same order for the instructions you give a model behind an app: identity (who the assistant is), instructions (the rules), examples, then context, which it says usually works best near the end.

Why prompt engineering matters

  • Better answers, first time. Anthropic says Claude responds well to clear, explicit instructions, and the more precisely you explain, the better the result.
  • Same quality every time. OpenAI notes that output changes from run to run, so a well-built prompt keeps results steady. It advises testing prompts with real inputs, not guessing.
  • Less time fixing. A good prompt saves the back and forth of “make it shorter”, “no, more formal”, “use a table”.
  • Fewer made-up facts. When you paste the source text and tell the AI to answer only from it, it has less room to invent things. Anthropic suggests asking the model to quote the relevant parts of a long document first.

When prompting is not the answer

Prompting is not magic. Anthropic says not every problem is best fixed with a better prompt: speed and cost, for example, are often easier to fix by picking a different model. Google notes that its Gemini models often do well on simple tasks with no special prompting at all. Prompt engineering pays off most on complex, repeated or high-stakes work.

Core prompt engineering techniques, with examples

These are the techniques that show up in all three official guides. Each one has a short example I wrote to show the idea.

1. Zero-shot prompting: just ask

A zero-shot prompt gives no examples. You only describe the task. OpenAI’s help page says to start here, then add examples if the result is not good enough.

Our example: zero-shot
Classify this customer message as Complaint, Question or Praise. Message: "My order from Nagpur still has not arrived after 9 days."

2. Few-shot prompting: show a few examples

A few-shot prompt includes a few sample inputs and outputs. The model picks up the pattern. Google’s AI Studio guide goes further than the others: it recommends always including few-shot examples, says clear examples can even replace some instructions, and warns that too many examples can make the model copy them too closely. Anthropic suggests 3 to 5 examples that are relevant, varied and wrapped in tags.

Our example: few-shot
Write a one-line product tagline. Product: Steel water bottle Tagline: Cold for 24 hours. Plastic for zero. Product: Cotton kurta Tagline: Soft enough for Chennai summers. Product: Masala chai mix Tagline:

Keep every example in the same layout. Google says mixed formats in examples lead to mixed formats in answers.

3. Role or persona prompting

Tell the AI who to be. Anthropic says setting a role focuses the model’s behaviour and tone, and even a single sentence makes a difference. Google lists persona as a standard part of a prompt.

Our example: weak prompt
Explain income tax slabs.
Our example: better prompt
You are a friendly CA explaining to a first-time salaried employee in India. Explain how income tax slabs work in under 200 words. Use one simple example with round numbers. End with: "Check the latest slabs on the Income Tax Department website."

Role + reader + length + a safety line. Tax rules change, so the prompt asks the reader to verify.

4. Step-by-step (chain-of-thought) prompting

For maths, logic or planning, ask the AI to work through the problem step by step before it gives the final answer. Google’s table calls this reasoning steps and says it can sometimes improve reasoning. Anthropic calls asking for step-by-step thinking a fallback for when the model’s built-in thinking mode is off, and suggests asking it to check its own answer at the end.

Our example: step by step
A shop sells 3 notebooks for Rs 120. A school needs 250 notebooks. Work it out step by step, then give the final cost on the last line as: Answer: Rs ___ Before you finish, check your maths once.

Newer “reasoning” models already think before they answer. OpenAI compares a reasoning model to a senior co-worker you can give a goal to, and a regular GPT model to a junior co-worker who needs exact steps. With reasoning models, give the goal and less hand-holding.

5. Ask for a set format (structured output)

Tell the AI the exact shape you want: a table, bullets, an email, or JSON for software. OpenAI’s help page says models respond better when you show the format, not only describe it. For apps, OpenAI and Google both offer a structured output feature that forces answers into a JSON schema.

Our example: set format
From the text below, pull out every company name and every date. Return exactly this format: Companies: <comma separated list> Dates: <comma separated list, DD Mon YYYY> Text: """ <paste text here> """

6. Use separators: ###, triple quotes or tags

When you paste a long text, mark where it starts and ends. OpenAI’s help page suggests putting the instruction first and fencing the text with ### or “””. Anthropic and OpenAI both suggest XML-style tags such as <context> and <instructions>, so the model does not mix up your rules with your data.

Our example: tags
<instructions> Summarise the meeting notes in 5 bullet points for the sales team. Mark any deadline in bold. </instructions> <notes> <paste meeting notes here> </notes>

7. Give context and ground the answer

The AI does not know your shop, your syllabus or your company policy. Paste it in. Google shows that a generic router troubleshooting answer becomes specific once the router manual is added to the prompt. OpenAI calls the bigger version of this retrieval-augmented generation (RAG): an app looks up the right documents and adds them to the prompt.

8. Break big jobs into smaller prompts

Google’s checklist flags “too many tasks” as a common problem: asking one prompt to summarise, extract, translate and draft an email at once. Its guides suggest one prompt per instruction, or a chain where the output of one prompt becomes the input of the next.

Our example: a 3-step chain
Prompt 1: Summarise this 10-page report in 10 bullet points. Prompt 2: From these 10 bullets, pick the 3 that matter most to a small business owner. Explain why. Prompt 3: Turn those 3 points into a 120-word WhatsApp message in simple Hindi.

9. Say what to do, not only what not to do

Both OpenAI and Anthropic give this tip. “Do not use jargon” is weaker than “Use words a Class 6 student knows.” Anthropic’s example: instead of “do not use markdown”, ask for “smoothly flowing prose paragraphs”.

Before and after: 5 real-life prompt makeovers

These are my own examples for common jobs in India. Try both versions in any free AI tool and compare.

Student: exam notes

Our example: weak prompt
Explain photosynthesis.
Our example: better prompt
You are a biology teacher for Class 10 CBSE students. Explain photosynthesis in 150 words. Then give: – the equation – 3 points to remember for the board exam – 1 common mistake students make Use simple English.

Small business: reply to a customer

Our example: weak prompt
Reply to this angry customer.
Our example: better prompt
You run a small online saree shop. Write a polite reply to the customer message below. Apologise once, give the new delivery date (12 Dec), and offer free shipping on the next order. Keep it under 80 words. No emojis. Customer message: """ <paste message> """

Creator: Instagram caption in Hinglish

Our example: weak prompt
Write a caption for my travel reel.
Our example: better prompt
Write 3 Instagram captions for a 30-second reel of a monsoon trek to Rajmachi near Lonavala. Language: Hinglish (Hindi words in English letters), casual, like talking to a friend. Each caption: max 2 lines, 1 question to get comments, 3 relevant hashtags.

Office: turn messy notes into a table

Our example: weak prompt
Make this neat.
Our example: better prompt
Turn the notes below into a table with columns: Task, Owner, Deadline, Status. If a deadline is missing, write "Not set". Do not add tasks that are not in the notes. Notes: ### <paste notes> ###

The rule “do not add tasks that are not in the notes” keeps the AI from inventing work.

Job seeker: improve a CV line

Our example: weak prompt
Improve my resume.
Our example: better prompt
You are a hiring manager for a digital marketing role in Bengaluru. Rewrite the 4 CV bullet points below so each starts with an action verb and shows a result. Keep each under 20 words. Do not invent numbers: if a number is missing, write [add number]. Bullets: """ <paste bullets> """

A walk-through of the official prompt guides

If you read only three pages about prompting, read these. Here is what each one teaches, with the key parts marked.

GuideBest forStandout advice
OpenAI: Best practices for prompt engineeringBeginners, ChatGPT usersInstructions first, separators, exact lengths, show the format, zero-shot then few-shot
OpenAI: Prompt engineering (API docs)People building appsIdentity, instructions, examples, context; test prompts; reasoning vs GPT models
Anthropic: Prompting best practicesClaude users and buildersBe clear and direct, the colleague test, XML tags, roles, long documents first
Google Cloud: Overview of prompting strategiesGemini users and buildersComponents table, sample template, prompt health checklist
Google AI Studio: Prompt design strategiesGemini API usersAlways add few-shot examples, break prompts down, iterate

Guides read 3 Dec 2026.

OpenAI: start simple, then add detail

OpenAI’s help centre article is the easiest place to start. It lists rules of thumb with a “less effective” and a “better” prompt for each. Rule 2: put the instruction at the top and fence your text with ### or triple quotes.

OpenAI Help Center rule 2 with the instruction-first heading and the triple-quote example highlighted, 3 Dec 2026
OpenAI Help Center rule 2 with the instruction-first heading and the triple-quote example highlighted, 3 Dec 2026

Rule 6 is the one most people miss: cut vague words. “Fairly short, a few sentences” becomes “a 3 to 5 sentence paragraph”.

OpenAI Help Center rule 6 with the exact-length better prompt highlighted and zoomed, 3 Dec 2026
OpenAI Help Center rule 6 with the exact-length better prompt highlighted and zoomed, 3 Dec 2026

The same page says to begin with zero-shot, then try few-shot, and only then consider fine-tuning (training a model on your own examples). It also notes that a lower temperature setting (0 is best for factual tasks like data extraction) makes answers less random. In the chat apps you usually cannot change temperature, so clear prompts do that job.

Anthropic: write for a smart new colleague

Anthropic’s prompting best practices page opens its general principles with be clear and direct. It asks you to think of Claude as a brilliant but new employee who does not know your norms. Its key test: show your prompt to a colleague with little context. If they would be confused, the AI will be too.

Anthropic prompting best practices with Be clear and direct, the new employee line and the colleague key test highlighted, 3 Dec 2026
Anthropic prompting best practices with Be clear and direct, the new employee line and the colleague key test highlighted, 3 Dec 2026

The page then explains XML tags: wrap instructions, context, examples and inputs each in their own tag so the model does not confuse them.

Anthropic best practices section Structure prompts with XML tags highlighted, 3 Dec 2026
Anthropic best practices section Structure prompts with XML tags highlighted, 3 Dec 2026

And roles: a single sentence in the system prompt, like “You are a helpful coding assistant specialising in Python”, focuses tone and behaviour.

Anthropic best practices section Give Claude a role with the one-sentence note highlighted, 3 Dec 2026
Anthropic best practices section Give Claude a role with the one-sentence note highlighted, 3 Dec 2026

Two more useful tips from the same page: put long documents at the top of the prompt and your question at the end, and explain why a rule matters, because the model can generalise from the reason. Anthropic also has a free interactive tutorial on GitHub. It notes the tutorial was written for older Claude 3 models, so follow the newer best practices page where they differ.

Google: a template and a health checklist

Google’s Overview of prompting strategies says prompt engineering is test-driven and iterative, and that two things decide quality: content (all the information needed) and structure (order, labels and separators). It offers a sample template with tags for objective and persona, instructions, constraints, context, output format, few-shot examples and a recap.

Its prompt health checklist is the most practical part. Two items surprise many people:

Google Cloud prompt health checklist with Overt manipulation and Too many tasks highlighted, 3 Dec 2026
Google Cloud prompt health checklist with Overt manipulation and Too many tasks highlighted, 3 Dec 2026
  • Overt manipulation: emotional appeals, flattery or pressure such as “very bad things will happen if you get this wrong”. Google says early models sometimes improved with such lines, but current models do not, and often get worse.
  • Too many tasks: one prompt that summarises, extracts, translates and drafts an email is trying to do too much. Split it.
  • Other items: typos in key words, undefined jargon, vague words like “brief” (say “3 sentences or less”), missing output format, conflicting instructions, and prompt injection risk when you paste text from strangers.

How to write a good prompt: 7 steps

  1. Write the goal in one sentence. What should exist when the AI is done? A summary, a table, an email, a plan?
  2. Name the reader. A child, a client, an examiner, your boss. This sets the level and the tone.
  3. Add the context. Paste the notes, the product details or the document. Fence it with ### or tags.
  4. Set the shape and size. “A table with 4 columns”, “5 bullet points”, “under 120 words”.
  5. Add a role or an example if needed. One line of role, or two short samples of the style you want.
  6. Run it and read the answer closely. What is missing, wrong or too long?
  7. Fix the prompt, not just the answer. Add the missing rule to the prompt, then save the improved prompt so you can reuse it.

Step 7 is the “engineering” part. OpenAI, Anthropic and Google all say the same thing: prompting is a loop of test and improve.

Common prompt mistakes and how to fix them

MistakeWhy it failsFix
“Write something about marketing”No goal, reader or size“Write 5 Instagram post ideas for a bakery in Indore, one line each”
Vague words: short, nice, detailedThe AI guesses what you meanUse numbers: 3 sentences, 150 words, 4 bullets
Only “don’ts”The AI knows what to avoid, not what to doSay the behaviour you want instead
Ten tasks in one promptSteps get skipped or mixedOne task per prompt, or a chain
Threats or bribes (“I will tip you”)Google says this no longer helps and can hurtGive clear reasons and rules
Examples in mixed layoutsAnswers copy the messSame format for every example
No source text, then trusting the factsModels can make things upPaste the source, ask it to use only that, verify yourself
Pasting private dataYour data leaves your deviceRemove names, numbers and IDs first

Guides read 3 Dec 2026.

Prompt checklist

Copy this list into your notes app. A prompt that ticks all 10 boxes will beat almost any “secret prompt” you see online.

Prompt checklist: tick all 10 before you press Enter

  • Goal: I said what I want in one clear sentence.
  • Reader: I said who the answer is for (a Class 8 student, a client, my boss).
  • Context: I pasted the facts, notes or document the AI needs.
  • Role: I gave the AI a role if it helps (teacher, editor, accountant).
  • Format: I asked for a shape: table, bullets, email, JSON, 5 lines.
  • Length: I gave a number (3 sentences, 150 words), not “short”.
  • Example: I showed one or two samples if the style matters.
  • Separators: my pasted text sits between ### marks, triple quotes or tags.
  • Do, not just don’t: I said what to do instead of only what to avoid.
  • Safety: no passwords, Aadhaar, PAN or client secrets in the prompt; I will check the facts.

Safety: privacy, facts and prompt injection

  • Do not paste secrets. Never put passwords, OTPs, Aadhaar, PAN, bank details or a client’s private data into a chatbot prompt.
  • Check facts. A confident answer can still be wrong. Verify numbers, laws, tax rules and medical advice on official sites.
  • Watch for prompt injection. Google’s checklist names it as a major security risk: if your app pastes text from users or web pages into a prompt, that text can contain hidden instructions. Keep untrusted text clearly fenced and tell the model it is data, not instructions.
  • Expect refusals. Google’s intro page says models may refuse prompts about hate speech, harassment, sexual content or dangerous activities. Rewording to trick the model breaks the tools’ rules.

Prompt engineering in India: languages and free tools

You do not need to prompt in English. Google’s help page lists more than 70 languages for the Gemini web app, including Hindi, Marathi, Bengali, Gujarati, Kannada, Malayalam, Odia, Punjabi, Tamil, Telugu, Urdu, Assamese and Nepali, and India is a supported country.

Gemini Apps Help supported languages list with Hindi and Marathi highlighted, 3 Dec 2026
Gemini Apps Help supported languages list with Hindi and Marathi highlighted, 3 Dec 2026
  • Say the language and script. “Reply in Marathi, Devanagari script” or “Hinglish in English letters” avoids mixed answers.
  • Give local context. City, rupee amounts, school board (CBSE, ICSE, state board), GST or UPI. The AI cannot guess these.
  • Check translations of key terms. For legal, medical or exam content, compare with an official source in that language.
  • Practise free. ChatGPT, Gemini and Claude all have free plans you can use to practise. See what each free plan gives in our best free AI tools list.
Our example: Marathi prompt
तू एक अनुभवी शिक्षक आहेस. इयत्ता 7 वीच्या विद्यार्थ्यांसाठी जलचक्र (water cycle) 100 शब्दांत सोप्या मराठीत समजावून सांग. शेवटी 3 प्रश्न दे, उत्तरांसह.

Role, reader, length, format: the same rules work in any language.

Is prompt engineering a career?

Prompting is now a basic work skill, like using a spreadsheet. The World Economic Forum Future of Jobs Report 2025 (January 2025, data from over 1,000 companies) expects skills in AI and big data, networks and cybersecurity to grow fastest by 2030, and says 77% of employers plan to upskill their workers. It does not list “prompt engineer” as a separate job.

In practice, most people use prompting inside other roles: content writers, marketers, support teams, teachers, analysts and developers. Developers who build AI apps do the deepest prompt work, often with testing tools and code. We found no official government or industry salary data for a “prompt engineer” job in India, so be careful with salary claims you see online.

Want to go further? Learn to test prompts on many inputs, learn basic Python to call AI APIs, and learn how structured output and RAG work. Our AI writing tools and AI research tools lists show where prompting is used every day.

Where to learn prompt engineering

Start with the free official guides linked above. Then practise for 15 minutes a day with your own real work: emails, notes, captions, reports. For a structured path, we compared free courses from DeepLearning.AI, IBM, Microsoft, AWS and others in 11 free AI prompting courses. If you are new to AI as a whole, start with our free AI courses list.

Frequently asked questions

What is prompt engineering in simple words?

It is the skill of writing clear instructions for an AI tool so it gives you a useful answer every time. You say what you want, give the facts it needs, show the format, and then improve the prompt after you see the answer.

What is an example of prompt engineering?

Instead of “write about Diwali”, you write: “You are a Class 5 teacher. Write a 120-word paragraph about how families in Maharashtra celebrate Diwali, in simple English, with 3 bullet points at the end.” The second prompt gives a role, a reader, a length and a format.

What are the main prompt engineering techniques?

Zero-shot (just ask), few-shot (give a few examples), giving a role or persona, asking for step-by-step reasoning, asking for a set format like a table or JSON, using separators like ### or tags, adding context, and breaking a big job into smaller prompts. OpenAI, Anthropic and Google all describe these in their official guides.

Is prompt engineering a good career in India?

Prompting is a useful skill, but it is mostly part of other jobs such as content, marketing, support, coding and data work. The World Economic Forum’s Future of Jobs Report 2025 says AI and big data skills are expected to grow fastest. It does not list prompt engineer as a separate job, and we found no official salary data for it.

Do I need coding to learn prompt engineering?

No. You can practise in ChatGPT, Gemini or Claude by typing in plain English or your own language. Coding helps only when you build apps that send prompts through an API.

Can I write prompts in Hindi or Marathi?

Yes. Google’s Gemini help page lists Hindi, Marathi, Bengali, Gujarati, Kannada, Malayalam, Odia, Punjabi, Tamil, Telugu, Urdu and more among its supported languages. The same rules apply: be clear, give context and ask for a format.

Does saying please or threatening the AI help?

Google’s prompt health checklist says emotional appeals, flattery and pressure (like “very bad things will happen”) no longer improve results and often make them worse. Politeness is fine, but clear instructions matter far more.

Where can I learn prompt engineering for free?

Start with the official guides from OpenAI, Anthropic and Google linked in this article, and Anthropic’s free interactive tutorial on GitHub. For structured courses, see our list of free AI prompting courses.

Who checked this

About this page

Pritam Sonone
Written and checked byPritam SononeFounder, Digital Pritam
  • WordPress developer and designer, builds sites for clients
  • WordCamp Asia Communication Co-Lead
  • 14K+ subscribers on the DigitalPritam YouTube channel

How we checked

Updated 3 Dec 2026
Official OpenAI, Anthropic and Google prompt guides read on 3 Dec 2026
Annotated screenshots taken by us without logging in
Before and after prompts are our own examples, not from the guides
Not sponsored, no affiliate links

How I got these facts

I read each official guide listed below on 3 Dec 2026 and paraphrased what it says, quoting only short phrases. I took and marked up the screenshots myself, without signing in. The example prompts were written for this article to show each technique. Guides change often, and model names inside them change every few months, so check the live pages before you rely on a detail.

Sources

Hostinger setup checklist PDF coverFREE PDF
Free checklist

Get the Hostinger setup checklist, plus every sale alert

The exact steps we use on our lab sites, and an email when each big hosting sale opens.

Sent instantly. Deal alerts until 1 Dec. Unsubscribe in one click.

Share