Say you've got 1,000 rows and only 10 of them are positive. If your model says negative for all of them it's 99% accurate, and its macro F1 is 0.497. I'd always start with that one because you can do it in your head, and it tells you why people use macro F1 when the classes aren't balanced (you get 0 for the positives and 0.995 for the negatives, and it's the plain average).
Now take a model that finds 8 of the 10 and raises 12 false alarms. It's gone down to 98.6% accuracy, so on that measure it's worse, but the F1 is 0.533 for the positives and 0.993 for the negatives and you end up with a macro F1 of 0.763. I'd much rather have this one if I had to find those positives.
The other 0.785
You might see somebody get 0.785 from those same predictions. They've averaged the precision over the two classes (0.699) and the recall (0.894), and then worked out one F1 from the two averages. If you do it class by class and average afterwards, you get 0.763.
def f1(tp, fp, fn): return 2 * tp / (2 * tp + fp + fn) each = (f1(8, 12, 2) + f1(978, 2, 12)) / 2 # 0.763 p = (8 / 20 + 978 / 980) / 2 r = (8 / 10 + 978 / 990) / 2 of_means = 2 * p * r / (p + r) # 0.785 scikit-learn averages the F1s, and I'd do the same. If you're comparing with a number in a paper, check which one they used, because a gap of two points is about what people claim as an improvement.
Micro F1 won't help you here
If every row gets exactly one label then micro F1 is the same as accuracy. Each mistake is a false positive for one class and a false negative for another, so when you add them up over the classes you've got 986 right, 14 and 14, and it's 0.986 again.
Classes that aren't there
I'd also decide what happens to a class with nothing in it. Suppose you've got three classes, the third doesn't turn up in your test set and your model never predicts it, and everything else is right. If you count it as 0 your macro F1 is 0.667, and if you leave it out it's 1.0. I'd take the classes that appear in either the labels or the predictions. If you only take them from the labels, a class you've predicted wrongly and that's never true won't have a row of its own in the average.
I normally put the per-class F1s next to the macro one for that reason. There's an exercise with tests if you'd like to write it yourself, at https://academicquant.co.uk/ml-macro-f1?utm_source=devto&utm_medium=post&utm_campaign=devto-macro-f1-two-definitions

