A long-standing problem in biological and social sciences is to understand the conditions required for the emergence and maintenance of cooperation in evolving populations. For many situations, kin selection is an adequate explanation, although kin-recognition may still be a problem. Explanations of cooperation between non-kin include continuing interactions that provide a shadow of the future (that is, the expectation of an ongoing relationship) that can sustain reciprocity, possibly supported by mechanisms to bias interactions such as embedding the agents in a two-dimensional space or other context-preserving networks. Another explanation, indirect reciprocity, applies when benevolence to one agent increases the chance of receiving help from others. Here we use computer simulations to show that cooperation can arise when agents donate to others who are sufficiently similar to themselves in some arbitrary characteristic. Such a characteristic, or `tag', can be a marking, display, or other observable trait. Tag-based donation can lead to the emergence of cooperation among agents who have only rudimentary ability to detect environmental signals and, unlike models of direct or indirect reciprocity, no memory of past encounters is required.