New York City’s Department of Buildings issues more than 4,400 violations a year for illegally converted basements, cellars and attics that cannot be occupied because of health and safety hazards, like poor ventilation or a lack of multiple exits.

But advocates of legalization say the point is to deal with an existing problem and allow better city planning. “We want a path to legalization,” said Jerilyn Perine, executive director of the research group Citizens Housing and Planning Council and a former city housing commissioner. “Not every unit should be legalized, but there are some that could.”