Can I work remotely for my foreign employer on a B-2 visa?
The rules do not clearly allow it. B-2 is for tourism, and a visit made in order to keep working is the risky version.
Not safely, and not as the purpose of the trip. A B-2 visa is for tourism, family visits and medical care, and a nonimmigrant may not take employment in the United States unless the status allows it (8 CFR 214.1(e)). No regulation says in plain words that answering a few emails for an employer abroad is allowed or banned, so the question turns on what the visit is really for.
Where the line is
The B-2 test is intent. A traveler who comes for a two-week holiday and checks in with the office back home a couple of times is in a different position from one who relocates a laptop and a work schedule to the United States for three months and calls it a holiday. The first looks like a visitor with a job. The second looks like a worker whose desk happens to be in Florida.
Three facts weigh most when an officer or a later adjudicator reads the situation:
Where the work is performed and who pays. Work for a foreign employer, paid abroad into a foreign account, is not competing for a US job. That is why many practitioners treat light remote work as tolerated. Tolerated is not the same as authorized, and the State Department has not published a rule that says so.
How long and how often. A short trip with incidental work reads differently from repeated long stays with full-time hours.
What you told the officer. An answer given at the border or the consulate that the visit is a holiday, followed by a month of full-time remote work, is the kind of mismatch that causes trouble.
What goes wrong
The consequence is not usually a penalty for the emails. It is a finding that the visit was not for the purpose stated. At a port of entry, CBP can refuse admission at a later trip if the pattern suggests you live and work in the United States. At a consulate, the next B-2 application is read against the earlier visits. A finding of willful misrepresentation of a material fact carries a permanent inadmissibility ground under INA 212(a)(6)(C)(i)), so the stakes are higher than the activity looks.
Related points
Tax is a separate question. Presence in the United States can create filing duties, and the substantial presence test counts days regardless of visa type. See the IRS guidance for nonresident aliens.
Anyone who actually wants to live in the United States and keep a foreign job needs a status that allows long stays. A B-2 does not. Staying past the admitted period is also a separate problem with its own consequences, described in the FAQ on overstays.
If the plan is to stay for months while working, or if an officer has already questioned a pattern of long visits, speak to an immigration attorney before the next trip. The answer depends on facts a general page cannot see.