How can I tell if I need to replace my battery? I have a refurbished Galaxy S3. Sometimes it charges to 100% while powered off, but reports 51% as soon as I start it up. Lately, it goes down to 50% or lower even right after charging.

I haven't installed many apps or used the phone extensively yet.

I find lots of links for determining battery drain, but nothing so far on how to tell if I need a new battery.

I'd like to be relatively sure it's a bad battery before replacing it.

Update:

I have eliminated the problem, but have no idea why what I did worked ;(

1) I bought an inexpensive charging-only cable. Using this, the phone charges very nicely.

2) I turned on Power Saving.

3) I bought a more expensive version of the battery.

Now the phone charges fully, lasts a long time, and keeps the charge when turned off.

None of this makes sense - especially the fact that it used to drain when turned off (not suspended). Changing the cable shouldn't have done much either because the old cable did charge the phone - or at least - the phone said it did.
Li Ion or Li Po batteries don't die suddenly - their performance degrades in terms of :
a) Short Term: Ability to hold charge and deliver expected performance
b) Long Term:: Deliver upto 80%  capacity upon being charged / discharged over a period of time (in other words life of battery). The battery is considered to be technically dead if it delivers less
There is no sure way of determining and saying this battery has gone bad, but there are a couple of things you could try:

Spin Test: Since your phone has user removable battery try this. For details, see this nice answer with embedded video.

Vbatt: This app should give a fairly good indication, since it simulates discharging under screen on condition . When you charge your battery to 100% (irrespective of the reading it shows on disconnecting ), activate this app widget and it will tell you the voltage level and how long it should last under screen on condition. Let it ruin till the battery nearly runs out and compare the predicted Vs actual. Simple. From app description




Vbatt is a simple battery widget for Android smartphones and tablets. It displays the current battery voltage (Vbatt) and  the remaining battery capacity (percentage) and optionally logs these values to a CSV-file.

The main reason for developing Vbatt was the differing behaviour of replacement batteries while discharging them in daily use ... For a better estimation of the remaining phone runtime the Vbatt widget displays in addition to the remaining capacity (percentage) the battery voltage



While battery voltage is arguably not the best indicator of health of battery, running this app can help you in a couple of ways
a) Giving you the current performance which you can compare with earlier performance as you recall or from Screen On Time (SoT) which you can gather from internet or forums
b)  If you can lay your hands on a new or properly performing battery from your friends, running this app on both batteries, you can easily judge for yourself. You can even ask your friend having the same phone to install this app, run it and compare.
Since your phone is refurbished, there could be another factor at play for deterioration in performance- date of manufacture of battery. Li Ion batteries (for that matter all batteries) suffer from Self Discharge At the rate of 4% every month, which means if your battery, even if it is original, but kept on the store shelf for say an year before being sold, it had already affected the longevity of battery and it shows up in performance
IMO, looking at the battery figures shared, I would recommend battery replacement (assuming no other reason like hardware issues). It would help you to decide by running tests mentioned