Google AdSense Code Converter Tool
Google AdSense Code Converter
Paste your AdSense code and get a version that Blogger accepts. Escape it for your theme, make a fixed ad responsive, or tidy it up in one click. Your publisher ID and ad slot stay untouched.
Convert your ad code
Paste the code from AdSense. The converted version updates as you type, with a quick health check underneath.
Three modes, one job each
Pick the one that matches where the code is going.
Blogger theme
Turns < and > into < and > so the code survives inside your theme's XML. Without this, Blogger refuses to save the template.
For Theme, Edit HTMLPlain HTML
Keeps the code as normal HTML and applies your switches only. Use it for an HTML or JavaScript gadget, or inside a post.
For Layout gadgets and postsUnescape
Reverses the escaping. Paste code copied from a Blogger theme and get readable HTML back to edit or move elsewhere.
For code copied from a themeWhat changes in Blogger theme mode
Only the characters Blogger cannot read inside a theme are replaced. Your IDs are never edited.
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-0000000000000000" data-ad-slot="1234567890"></ins>
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-0000000000000000" data-ad-slot="1234567890"></ins>
Keep your ad code policy compliant
AdSense limits how ad code may be changed. This tool never edits your publisher ID or ad slot, and Responsive mode only uses the documented size attributes. If you are unsure about a change, check the current AdSense program policies first.
Questions about AdSense code in Blogger
Quick answers for the most common errors.
Why does Blogger say my XML is not well formed?
Blogger themes are XML files, so a raw < or & inside your ad code breaks them. Use Blogger theme mode to escape those characters, then paste the result again.
Do I need to escape code in an HTML gadget?
No. Gadgets and posts accept normal HTML, so use Plain HTML mode there. Escaping is only for the theme editor.
How many times should the loader script appear?
Once per page. If your theme head already has it, turn on Remove loader script so each ad unit carries only its own tag and push call.
What does Make responsive change?
It swaps a fixed width and height for a block display and adds the auto format and full width responsive attributes, so the ad fits the screen. Units that are already responsive are left alone.
Is my ad code uploaded anywhere?
No. The conversion runs in your browser. Your code is not sent to a server and is not saved.
Get your ad code into Blogger without errors
Paste, convert and copy. It takes a few seconds.