Google Sheets
2 min read

How to Embed a Google Docs Editor in Your Website

Paul

Published in Google Sheets

Want to allow users to view or edit a Google Doc directly from your website? Whether you're creating a collaborative workspace, a shared notes system, or a web-based writing tool, embedding a Google Docs editor can be powerful — and surprisingly simple.

Here’s how to do it step by step.

GleanWise Logo GleanWise

Transform Your Google Sheets into Portals

Gleanwise lets you transform your Google Sheets into portals. Make them public or private to share with clients or team.

Learn More

1. Change the Sharing Permissions

Before embedding, make sure the document is accessible:

  1. Open your Google Doc
  2. Click Share (top-right)
  3. Under “General access,” select:
  4. Viewer if you want read-only access
  5. Commenter or Editor for collaborative access
  6. Choose “Anyone with the link” to avoid sign-in requirements

2. Embed the Google Doc Viewer (Read-Only)

If you want people to view your doc but not edit it, use the "preview" URL in an iframe.

Steps:

  1. Copy your document ID from the URL (it’s the long string between /d/ and /edit)
  2. Use this iframe code:
<iframe
src="https://docs.google.com/document/d/DOC_ID/preview"
width="100%"
height="600"
frameborder="0">
</iframe>

✅ Great for public displays, documentation, or publishing terms & policies.

GleanWise Logo GleanWise

Ready to Create Your Own Portal?

Turn your Google Sheets into professional portals in minutes with Gleanwise.

Learn More

3. Embed the Editable Google Docs Interface

If you want to embed the actual Google Docs editor (with editing tools), it's possible — but your users must be signed in and have editing permission.

Steps:

  1. Use this iframe code instead:
<iframe
src="https://docs.google.com/document/d/DOC_ID/edit"
width="100%"
height="800"
frameborder="0">
</iframe>

📌 Make sure the users you’re targeting:

  1. Have Google accounts
  2. Have editing access to the doc

Note: This isn’t ideal for embedding in public-facing websites. It’s more suited for internal dashboards or tools behind a login wall.

4. Tips for Better Embedding

  1. Responsive Design: Use a wrapper div with CSS to make the iframe mobile-friendly.
  2. Security: Don’t embed editable docs on public pages without access control.
  3. Alternatives: Use platforms like Notion or Coda for more control over embeds and permissions.

5. Use Google Apps Script or Add-ons (Advanced)

If you need to create or manage multiple embedded documents dynamically, you can automate access using Google Apps Script. This allows you to create documents programmatically, set permissions, and embed them into custom portals.

Conclusion

Embedding a Google Docs editor or viewer on your website can supercharge collaboration, simplify content sharing, and cut down on third-party tools. Whether you're creating a shared document space or just want to display a polished doc, Google Docs + iframes = fast and flexible.

GleanWise Logo GleanWise

Start Building Your Portal Today

Join others who are already using Gleanwise to share their data beautifully.

Learn More