Copying Facebook comments by hand is slow work. Fifty comments means fifty selections, fifty pastes, and a spreadsheet full of stray formatting you then have to clean out. If you need that data for research, lead generation, audience analysis, or content monitoring, the manual route stops being practical somewhere around the third post.
So I wrote a browser script that does it in one click. It reads the comments loaded on a Facebook post and lets you export Facebook comments to JSON, CSV, or Markdown, or copy the whole set straight to your clipboard. No API keys, no developer account, no code to write.
What you get when you export Facebook comments
Every comment the script finds becomes one record, with these fields:
- Commenter name — the display name on the account
- Comment text — the full body, not a truncated preview
- Reaction count — how many reactions that individual comment received
- Profile link — the URL of the commenting account
- Timestamp — when the comment was posted
- Reply depth — a number showing how deeply nested the comment sits, so a top-level comment and a reply-to-a-reply stay distinguishable after export
That last field matters more than it sounds. Once comments land in a flat spreadsheet, the thread structure is gone unless something records it. Reply depth is what lets you reconstruct who was answering whom.
The script adds a floating toolbar to the page and detects Facebook post and page URLs on its own, so there is nothing to configure per post. Scan, pick a format, download.
Installing the Tampermonkey userscript
What a userscript is
A userscript is a small JavaScript file that runs inside your own browser, on pages you choose. It is not an app, not a server, and not a Facebook integration. It runs only while you have the page open and you are logged in as yourself, and it sees exactly what your browser already sees — nothing more.
Userscripts need a manager to run them. Tampermonkey, the userscript manager for Chrome, Firefox, and Edge, is the one I build against.
Getting the script running
- Install Tampermonkey from your browser's extension store.
- Open the Tampermonkey dashboard and choose to add a new script.
- Paste in the contents of
Facebook Comments Export_v1.0.jsand save. - Open any Facebook post. The toolbar appears in the corner of the page.
If the toolbar never shows up, the usual cause is that the script's match pattern does not cover the URL you are on. Mobile Facebook and the desktop site run on different hosts, and a pattern written for one will not fire on the other.
Export Facebook comments to CSV, JSON, or Markdown
Load every comment first
This is the step that catches people out. Facebook does not put every comment into the page at once. It loads a handful and hides the rest behind "View more comments" and "N replies" links. The script can only export Facebook comments that are actually present in the page when you hit scan.
Why your export comes out short
If a post shows 400 comments and your CSV has 12 rows, nothing is broken. You exported the 12 that were loaded. Keep clicking "View more comments" until the link stops appearing, expand the reply threads you care about, then run the scan.
Picking a format
- CSV opens directly in Excel, Google Sheets, or Airtable. It follows the field and quoting conventions set out in RFC 4180, the reference specification for comma-separated values, so commas and line breaks inside a comment survive the trip instead of splitting your columns.
- JSON keeps the nesting intact and is the right choice when the data is heading into code or a database. MDN's introduction to working with JSON covers the structure if the format is new to you.
- Markdown is for reading — pasting a thread into a report, a brief, or a Notion doc.
- Clipboard skips the file altogether and drops everything straight into whatever you have open.
Where this script stops
Private groups and login state
The script sees what your logged-in browser sees. A private group you belong to works fine. A group you are not a member of does not, and no browser script changes that.
Facebook changes its markup
The script locates comments by matching patterns in the page structure. Facebook ships layout changes regularly, and when the structure shifts, selectors that worked last month start returning empty results. This is normal for every browser-based scraping tool, mine included. It means a script like this needs occasional maintenance, which is worth knowing before you build a recurring process on top of it.
Volume
One post at a time, with a person at the keyboard, is what this is built for. Forty posts a week across six pages is a different job with different tooling.
Terms of service and robots.txt are your call
I am not going to tell you that scraping any particular site is legal. What I can tell you is the technical situation: this script runs in your own browser, on pages your account can already see, and it makes no requests a normal browsing session would not make.
Whether that sits comfortably with Facebook's terms of service, and what its robots.txt asks of automated clients, is a decision for you — and, if the data has commercial value, for your lawyer. Check both before you build a process around any scraper.
When a browser script is not enough
A userscript is the right tool when a person is at the keyboard and the job is one post. It becomes the wrong tool the moment the work needs to run on a schedule, or across hundreds of URLs, or without anyone watching.
That is where the rest of my work sits: Python and Playwright bots that drive a real browser unattended, pipelines that write into PostgreSQL, SQLite, Google Sheets, or Airtable instead of a downloads folder, and scheduled jobs triggered by REST or webhook calls. My browser automation services explain how those pieces fit together, and there are other build write-ups in the DatafetchPro article archive.
Get a version built for your workflow
If this script does most of what you need but not all of it — different fields, a different output shape, a Chrome extension instead of a userscript, or the same job running nightly without you touching it — that is a build, and builds are what I do. Every project runs through Fiverr. Start from my custom scraper build service, or read who I am and how I work first.
